【发布时间】:2015-02-11 22:40:37
【问题描述】:
我正在尝试使用“file_get_contents”函数在 Facebook 上共享链接的总数。
这是我的代码:
$url = x;
$data = file_get_contents('http://graph.facebook.com/?id=".$url');
$obj = json_decode($data, true);
$like_no = intval($obj->{'shares'});
echo $like_no;
我试过了,但它不起作用。但是我的服务器上启用了 file_get_contents,所以我找不到解决方案......如果你能帮助我!在此先感谢:)
【问题讨论】:
-
$data 是我从 facebook 图表中得到的。例如:graph.facebook.com/?id=http://facebook.com
标签: php facebook count share file-get-contents