TSeed
April 19th, 2011, 01:07 AM
Hello everyone, I am new to parsing and properly referencing JSON objects or associative arrays in PHP with the Facebook Graph API.
Here is an example of JSON i will be working with:
https://graph.facebook.com/comments/?ids=http://www.youtube.com/watch?v=fyF-fj-1coY&feature=player_embedded
$request_url ="https://graph.facebook.com/comments/?ids=" . $purl;
$requests = file_get_contents($request_url);
$fb_response = json_decode($requests);
How can I implement a foreach function to cycle through and echo the id's of each element in the data array?
Thanks in advance!
Here is an example of JSON i will be working with:
https://graph.facebook.com/comments/?ids=http://www.youtube.com/watch?v=fyF-fj-1coY&feature=player_embedded
$request_url ="https://graph.facebook.com/comments/?ids=" . $purl;
$requests = file_get_contents($request_url);
$fb_response = json_decode($requests);
How can I implement a foreach function to cycle through and echo the id's of each element in the data array?
Thanks in advance!