Re: PHP - Parsing JSON from FB Graph
It's just a bunch of nested objects with an array thrown in there.
PHP Code:
foreach ($fb_response as $key => $response) {
foreach ($fb_response->$key as $data) {
foreach ($data as $item) {
echo 'ID: ' . $item->id . '<br />';
echo 'From ID: ' . $item->from->id . '<br />';
echo 'From Name: ' . $item->from->name . '<br />';
echo 'Message: ' . $item->message . '<br />';
echo 'Timestamp: ' . $item->created_time . '<br /><br />';
}
}
}
If the post was helpful...Rate it! Remember to use [code] or [php] tags.