I have convert my object data to an array and now i am trying to extract certain parts from the multi dimensional array however i am having some problems. Assistance is appreciated, thank you.
/* PHP SDK v4.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'GET',
'/89647580016/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject()->AsArray();
/* handle the result */
// print data
echo '<pre>' . print_r( $graphObject, 1 ) . '</pre>';
The following is the output:
Array
(
[data] => Array
(
[0] => stdClass Object
(
[id] => 89647580016_10153019927930017
[from] => stdClass Object
(
[name] => Central Casting Los Angeles
[category] => Local Business
[category_list] => Array
(
[0] => stdClass Object
(
[id] => 176831012360626
[name] => Professional Services
)
)
[id] => 89647580016
)
[message] => ***NON Union Submissions***
Must be registered with Central Casting!
Jessica is currently booking a TV show working tomorrow Friday June 26th with a possible recall Monday June 29th in LA. These will be Night Calls, so you must be okay working late into the night.
She is looking for Caucasian looking men, who appear to be in their 30's-50's, who appear to be very upscale, who have business suits.
If this is you please call submission line 818-260-3952. Thank you!
[actions] => Array
(
[0] => stdClass Object
(
[name] => Comment
[link] => https://www.facebook.com/89647580016/posts/10153019927930017
)
[1] => stdClass Object
(
[name] => Like
[link] => https://www.facebook.com/89647580016/posts/10153019927930017
)
[2] => stdClass Object
(
[name] => Share
[link] => https://www.facebook.com/89647580016/posts/10153019927930017
)
)
How can i print all the ['message'] ? I tried:
foreach ($graphObject as $key => $value) {
echo '<br>'.$key['message'];
}
But i got a error. Thank you for your help.