Reputation: 107
i use this code but its not working
$uid =$facebook->getUser();
$picture="http://graph.facebook.com/".$uid."/picture?type=large";
Upvotes: 0
Views: 179
Reputation: 5021
The code you share, is a Graph API call to get the User Picture,
you can use this function to get the user picture:
function avatar($id,$size) {
if ($size) {
$size = '?type='.$size.'';
}
return '<img src="https://graph.facebook.com/'.$id.'/picture'.$size.'" alt="" />';
}
i pass a second variable for the picture size, so you can use it like this:
echo avatar($uid,'square');
Upvotes: 2