Reputation: 12096
Im trying to get shares count from this Facebook graph call using php but am having no luck:
http://graph.facebook.com/?ids=http://google.com
Try 1
$content = file_get_contents("http://graph.facebook.com/?ids=http://google.com");
$parsedJson = json_decode($content, true);
echo $parsedJson['shares'];
Try 2
$content = file_get_contents("http://graph.facebook.com/?ids=http://google.com");
$parsedJson = json_decode($content, true);
echo $parsedJson->shares;
What am I doing wrong?
Upvotes: 0
Views: 64
Reputation: 4866
This will work!
echo ($parsedJson->{'http://google.com'}->shares);
Upvotes: 0