Social media marketing is the best part of the website promotion. It gives you quality traffic and helps to build readership. If you have a Facebook fan page for your blog or website it helps you to reach out to more potential reader. If you get Facebook page has more number of users, it is more likely to attract more users. People generally go for those pages which already have more number of member.
If you also have a Facebook page for your website, showing user count is the best idea to attract more number of users for your Facebook page. If you to show only the count of fan page followers, this code snippet is for you.
This PHP code will show the exact count of Facebook followers of you Facebook page.
Add your Facebook page id at the place of PAGE_ID_HERE at the second line of the code.
$page_id = “YOUR PAGE-ID”;
$xml = @simplexml_load_file(“http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=”.$page_id.””) or die (“a lot”);
$fans = $xml->page->fan_count;
If you have any problem in implementing the code, let me know via comments.
See more code snippet: