使用file_get_contents()获取facebook graph api的信息,但是有时会收到错误。
我发现必须使用cURL而不是file_get_contents()。
问题在于,我不知道如何使用cURL来传递URL。
如果我转换了
file_get_contents($graph_url);
将其转换为cURL,代码是什么?
$graph_url的内容如下:
$graph_url= "https://graph.facebook.com/me/photos?"
. "url=" . urlencode($photo_url)
. "&message=" . urlencode('')
. "&method=POST"
. "&access_token=" .$access_token;