Saturday, March 2, 2013

Get facebook page likes php

3/02/2013

It is simple php code that get the number of users who like a particular Facebook page
<?php
/* 
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/

$fb_URL = "http://www.facebook.com/forevertutorials"; # FB Page url
$myurl = "https://graph.facebook.com/".$fb_URL."?fields=likes";
$result = file_get_contents($myurl);
$response = json_decode($result, true);

if(count($response))
{


echo "FB Page URL: ". $fb_URL;
echo "
";
echo "FB Page ID: ". $response['id'];
echo "
";
echo "FB Page TOTAL LIKES: " .$response['likes'];
echo "
";


}



?>

helpful? Share this

The Editorial Team of 4everTutorials consists of a group of PHP Professionals.

0 comments:

 

© 2014 4everTutorials. All rights resevered.

Back To Top