如何使用PHP获取Facebook个人资料照片? [英] how to I get the Facebook profile photo with PHP?

查看:101
本文介绍了如何使用PHP获取Facebook个人资料照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取用户当前的个人资料照片...

I am trying to get the user's current profile photo...

任何人都可以帮助吗?

can anyone assist over here?

谢谢!!

推荐答案

try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');

    $updated = date("l, F j, Y", strtotime($me['updated_time']));

    echo "Hello " . $me['name'] . "<br />";
    echo "You last updated your profile on " . $updated  . "<br />" ;
    echo "<img src='https://graph.facebook.com/".$uid."/picture'/>"; 
}//end try getUser 
catch (FacebookApiException $e) {
    echo "Error:" . print_r($e, true);
}//end catch getUser 

这篇关于如何使用PHP获取Facebook个人资料照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆