API for getting total number of likes of a facebook page.Facebook Graph API - it just returns JSON data
http://graph.facebook.com/propertyonline.ae
Example :-1
function fblikes($username)
{
$url = 'http://graph.facebook.com/'.$username;
$ch = curl_init();
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$result = json_decode($output);
return $result->likes;
}
echo $total = fblikes('propertyonline.ae');
?>
Example :-2
function fblikes($username)
{
$data = file_get_contents('http://graph.facebook.com/'.$username);
$result = json_decode($data);
return $result->likes;
}
echo $total = fblikes('propertyonline.ae');