I'm attempting my first parsing of JSON with PHP and having some issues. I've searched around and even followed some solutions from SO however no luck.
So my PHP looks like:
$string = file_get_contents("SOME_URL_HERE");
$json_a = json_decode($string);
foreach($json_a->items as $mydata)
{
echo $mydata->uploader . "\n";
}
And that JSON url shows data that looks like (I've cut this down slightly):
{
'apiVersion': '2.1',
'data': {
'updated': '2013-03-21T16:27:35.191Z',
'totalItems': 18620,
'startIndex': 1,
'itemsPerPage': 5,
'items': [
{
'id': 'DiiDwOJqwQg',
'uploaded': '2012-12-22T15:20:51.000Z',
'updated': '2013-03-18T14:44:08.000Z',
'uploader': 'paramountmoviesuk',
Any ideas what I'm doing wrong?
Thanks