facebook - How to store graph data in a php variable? -
facebook - How to store graph data in a php variable? -
i trying number of likes of particular page on website , store in array. stuck in middle, figured out can number of likes along other info next code:
/*$site="http://graph.facebook.com/?ids=http%3a%2f%2xxxxxxxx.com/abc.php"; $graph= file_get_contents($site);
the output follows:
{"http:\/\/xxxxxxxx.com\/abc.php":{"id":"http:\/\/xxxxxxxx.com\/abc.php","shares":75,"comments":3}}
is there way can store number of likes i.e. in case 75 in php array?
i tried explode(); problem url using wont of constant length.
this json string decode it, utilize json_decode output array. ref : http://php.net/manual/en/function.json-decode.php
$array = json_deocde($json_string, true); echo "<pre>"; print_r($array);
php facebook facebook-graph-api facebook-like
Comments
Post a Comment