codeigniter:curl与facebook图
我试图用他的facebook id获取用户的大图像, 这是我的尝试codeigniter:curl与facebook图,codeigniter,facebook-graph-api,curl,Codeigniter,Facebook Graph Api,Curl,我试图用他的facebook id获取用户的大图像, 这是我的尝试 $fb_id = 100007869520485; $url = 'http://graph.facebook.com/'.$fb_id.'/picture?type=large'; echo $this->curl->simple_get($url); 但它不起作用! 任何帮助当前您的请求url更改为错误格式: http://graph.facebook.com/1.0000786952048E+14/pic
$fb_id = 100007869520485;
$url = 'http://graph.facebook.com/'.$fb_id.'/picture?type=large';
echo $this->curl->simple_get($url);
但它不起作用!
任何帮助当前您的请求url更改为错误格式:
http://graph.facebook.com/1.0000786952048E+14/picture?type=large
+-----------------+
将100007869520485
放在“
内,以便将其视为字符串。否则,php
会自动将这个大数字转换为科学模式数字
$fb_id = "100007869520485";
UPDATE::With curl:
$fb_id = "100007869520485";
$url = 'http://graph.facebook.com/'.$fb_id.'/picture?type=large';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch);
curl_close($ch);
print "$result\n";
$fb_id=100007869520485代码>echo$this->curl->simple\u get(“http://graph.facebook.com/$fb_id/图片?类型=大“)代码>未工作:(按我说的做。“
”在哪里?使用这个:$fb\u id=“100007869520485”
还有这个:echo$this->curl->simple\u get(“http://graph.facebook.com/100007869520485/picture?type=large")
无法使用简单获取的重定向处理。请检查我返回图像的更新答案!这就是您想要的图像。只需使用文件\u put\u contents
或类似功能将$result
保存到jpg
中即可。