//Facebook Comment Count function fb_comment_count($pURL) { $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $pURL); $json = json_decode($filecontent); $count = $json->$pURL->comments; if ($count == 0 || !isset($count)) { $count = 0; } echo $count;