This code had been deprecated, follow this link for a more updated code.

facebook-count-php
Facebook had change their API flow to work with apps. Previous PHP code to acquire your Facebook page like count might not work anymore. The API needed access token or auth configuration of an apps for it to GET the like count of your Facebook page. Here’s a simple PHP snippet for you to get Facebook page like count without access token. Copy or add this to your custom functions.

<?php
function dez_get_the_fb_like( $fb_pagename = '' ) {
$fburl = 'https://www.facebook.com/'. $fb_pagename;
$params = 'select like_count from link_stat where url = "'.$fburl.'"';
$component = urlencode( $params );
$urls = 'http://graph.facebook.com/fql?q='.$component;
$string = file_get_contents( $urls );
if( $string ) {
 $fbLIkeAndSahre = json_decode( $string );
 $getFbStatus = $fbLIkeAndSahre->data['0'];
 $likecount = $getFbStatus->like_count;
 return $likecount;
} else {
 return 'Data did not exist';
}
}
?>

and use this any where in your templates or php application.

<?php
echo dez_get_the_fb_like( $fb_pagename = 'YOUR PAGE NAME NOT ID' );
?>

Check this free WordPress plugin that have built-in social counter widgets.

Related Tagged Posts:

Protect Yourself From Facebook Imposters
Protect Yourself From Facebook Imposters
How to Promote Small Food Business on Facebook
How to Promote Small Food Business on Facebook
Optimising Your Facebook Messenger Marketing
Optimising Your Facebook Messenger Marketing
What Were The Biggest Online Trends of 2015?
What Were The Biggest Online Trends of 2015?