I have this code
$graph_url = "https://graph.facebook.com/100000070848126/statuses?access_token=".$params['access_token'];
$status = json_decode(file_get_contents($graph_url),true);
echo $status->data->message;
and I’m having a problem on how to output data in the array $status. I just don’t know how to call the items for this feed
The second parameter of
json_decode()is whether to create an associative array or not.You specified that you do want an array, so the way you would access the values would be like this –
If you leave out the
trueparameter of thejson_decode()function, you’ll be able to access the values in a more object oriented way like the syntax in your question.