Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用此代码,但它不工作
$uid =$facebook->getUser(); $picture="http://graph.facebook.com/".$uid."/picture?type=large";
你分享的代码,是一个Graph API调用来获取用户图片, 你可以使用这个函数来获取用户图片:
function avatar($id,$size) { if ($size) { $size = '?type='.$size.''; } return '<img src="https://graph.facebook.com/'.$id.'/picture'.$size.'" alt="" />'; }
我传递了图片大小的第二个变量,所以你可以像这样使用它:
echo avatar($uid,'square');