Hear 是我的代码。我想用api php facebook拍照。变量 $photo 返回 NULL 值。
<?php
$profile = $facebook->api('/<idfacebook>');
$photo = $facebook->api('/'.$profile['username'].'/picture');
?>
来自 stackoverflow.com/questions/2821061
"只需通过此 url 获取数据: http://graph.facebook.com/sarfraz.anees/picture
将sarfraz.anees(我的名字)替换为您要获取其照片的用户的名称。您可以使用 PHP 的 file_get_contents
函数来读取该 url 并处理检索到的数据。
资源:http://developers.facebook.com/docs/api
注意:在 php.ini 中,您需要确保启用 openssl 扩展以使用 PHP 的file_get_contents
函数来读取该 url。 '"