I'm trying export data to variables. I have data in this form:
{
"data":[{
"unread": 1,
"id":"1111",
"updated_time":"2015-01-21T00:00:38+0000",
"comments":{
"data":[{
"id":"1111_2222",
"from":
{
"id":"9999",
"name":"John"
},
"message":"Hello Steve, how are you?",
"created_time":"2015-01-21T00:00:38+0000"
}]
}
}]
}
I have following code but it exports only unread, id and updated_time. However I need even data from comments (message, id, name - from).
foreach ($fb_response->data as $item) {
echo 'unread: ' . $item->unread . '<br />';
echo 'From ID: ' . $item->id . '<br />';
echo 'Time: ' . $item->updated_time;
}