• Posted: 2010-12-01
  • Author: VisualMIND
  • Tags:

Display number Facebook Fans

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
<?php
$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;
echo $fans;
?>

Instructions:

If you want to display the number of your Facebook Fans then use this code.

Replace “YOUR PAGE-ID” with your own Page-ID.


Share this snippet

If you like this snippet, share it with friends!