I am trying to get the number of likes of a particular page on my website and store it in an array. Stuck in middle, i figured out that i can get the number of likes along with other data by the following code:
/*$site="http://graph.facebook.com/?ids=http%3a%2f%2xxxxxxxx.com/abc.php";
$graph= file_get_contents($site);
the output is as follows:
{"http:\/\/xxxxxxxx.com\/abc.php":{"id":"http:\/\/xxxxxxxx.com\/abc.php","shares":75,"comments":3}}
is there a way i can just store the number of likes i.e. in this case 75 in a php array?
I tried explode(); but the problem is that the url that i would be using wont be of a constant length.