你好我有一个代码,但我不知道它为什么不起作用。
我希望从Facebook获得更多相同的API,例如分享,喜欢,评论和其他...
function facebook_shares($url){
$fql = "SELECT url, normalized_url, share_count, like_count, comment_count, ";
$fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM ";
$fql .= "link_stat WHERE url = '".$url."'";
$apifql="https://graph.facebook.com/fql?q=".urlencode($fql);
$fb_json=file_get_contents($apifql);
return json_decode($fb_json);
}
我想用
输出计数<?php $fb = facebook_shares($url);
echo $fb[0]->share_count;
?>
我收到此错误
<b>Fatal error</b>: Cannot use object of type stdClass as array in <b>C:\xampp\htdocs\report.php</b> on line <b>856</b><br><b>Fatal error</b>:
谢谢