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.
我使用 php 创建了一个网站,我可以在其中获取用户的 facebook 用户 ID、电子邮件 ID、FB ID 和其他一些东西。我是否可以从 facebook 获取个人资料图片,因此用户在进入系统时不需要上传图片?
您可以使用以下 URL 获取 Facebook 个人资料照片:
http://graph.facebook.com/ID/picture
因此,对于当前已通过身份验证的用户,您只需使用 SDK 中返回的用户 ID:
$user = $facebook->getUser(); $url = "http://graph.facebook.com/{$user}/picture";