Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show likes of a fan page Facebook in your page
<html>
<body>
<?php
//persian comment
// value page_id zir ra be value page id khod jabeja konid
// bari bedast avardan value page be in site http://findmyfacebookid.com/ moraje konid
//English comment
//change value of page_id to your page id of fanpage
//you can find your page value id with this site : http://findmyfacebookid.com/
$pageId = "124878794919";
$xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$pageId."") or die ("a lot");
$count = $xml->page->fan_count;
?>
<a class="FB" href="https://www.facebook.com/pages/Web-Bro/124878794919?ref=hl" style="text-decoration:none; "> <?php echo $count; ?> </a>
// webbro.ir
<body>
<html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.