0

I am using this code to get the user friend's list. For profile picture i am unable to find any reference please guide if you know the process

$facebook = new Facebook($config);

$user_id = $facebook->getUser();
$iLimit=99;
if($user_id) {

     // We have a user ID, so probably a logged in user.
     // If not, we'll get an exception, which we handle below.

     try {

       $user_profile = $facebook->api('/me','GET');
      echo"<h3>";

echo 'Name: ' . $user_profile['name'];
echo"</h3>";
$profile_pic =  "http://graph.facebook.com/".$user_id."/picture";

echo "<img src=\"" . $profile_pic . "\" />"; 
$user_friends = $facebook->api('/me/friends', 'GET' );
print_r($user_friends);            //Given NULL Value 
echo "</pre>";\

Returning null value

n.sharma
  • 1
  • 3

1 Answers1

0

Please refer to the facebook graph api docs https://developers.facebook.com/docs/graph-api/reference/friend-list/ and here is the code with tutorial http://www.sanwebe.com/2011/10/facebook-friends-list-pagewise-with-php Hope it helps !

Pardeep Poria
  • 1,049
  • 1
  • 7
  • 12