Issue
so I have this:
$pages = (new FacebookRequest($session, 'GET', '/search?q=Computers/Technology&fields=likes'))->execute()->getGraphObject()->asArray();
I just want to get the likes of those pages, so I did $pages["likes"]
also tried $pages->likes
and I get null.
But when i do var_dump($pages)
it shows all the data. So why can't I get just the likes?
Solution
Depending on what var_dump($pages) returns, you may need to do something like $pages[''][''] to get to the likes. I'm not sure since you didn't include that.
If the value isn't undefined and you can actually see the data using var_dump, you shouldn't have any problem getting to the specific fields once you understand the structure. Try
print_r($pages)
as well to see your info. Also, as long as there's no sensitive data, post the output or a sample of the output to help us with out answers.
Cheers!
Answered By - Tim Lewis
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.