如何将评论数拉入带有facebook评论的php变量?
我在我的网站上使用fb评论,我需要把评论的数量拉到一个php变量中,这样我就可以操纵它了。我该怎么做?提前感谢。从FQL表中获取评论框计数: PHP示例:如何将评论数拉入带有facebook评论的php变量?,php,facebook-comments,Php,Facebook Comments,我在我的网站上使用fb评论,我需要把评论的数量拉到一个php变量中,这样我就可以操纵它了。我该怎么做?提前感谢。从FQL表中获取评论框计数: PHP示例: $query = urlencode("select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'"); $response = json_decode(file_get_contents("https:
$query = urlencode("select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'");
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
if(!empty($response['data'][0]['commentsbox_count'])) {
echo $response['data'][0]['commentsbox_count'] . " comments were found!";
}
$query = urlencode("select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'");
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
if(!empty($response['data'][0]['commentsbox_count'])) {
echo $response['data'][0]['commentsbox_count'] . " comments were found!";
}