This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 25th, 2012  |  syntax: PHP  |  size: 0.29 KB  |  views: 644  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         //Facebook Comment Count
  2.         function fb_comment_count($pURL) {
  3.  
  4.         $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $pURL);
  5.         $json = json_decode($filecontent);
  6.         $count = $json->$pURL->comments;
  7.         if ($count == 0 || !isset($count)) {
  8.                 $count = 0;
  9.         }
  10.         echo $count;
clone this paste RAW Paste Data