我想下载Facebook个人资料图片的Facebook应用程序。为此,我在$uid
中获得Facebook用户名/ ID的值。 echo $uid
正显示出正确的结果,但是当我在下面的代码中使用它,它不是拿起值:
echo $uid;
$imgDestinationPath = 'pic.jpg';
$link = 'http://graph.facebook.com/$uid/picture?type=large';
$content = file_get_contents($link);
file_put_contents($imgDestinationPath, $content);
error_reporting(E_ALL);
而且,当我把代替$uid
Facebook的用户名,它下载的图片即可。 请帮忙。我是PHP新手。
附加使用error_reporting(E_ALL);到代码的开头,并寻找错误 – 2011-12-26 12:13:54