Display Facebook fans count in full text php code

Want to display how many Facebook fans do you have, in full text, on your blog? It’s very easy using the following snippet:



function fb_fan_count($facebook_name){
// Example: https://graph.facebook.com/digimantra
$data = json_decode(file_get_contents("https://graph.facebook.com/".$facebook_name));
echo $data->likes;
}

Popular posts from this blog

Text messaging with PHP using the TextMagic API

Detect location by IP using php code

php download code