title: How to get number of Facebook page likes
body: <p>my following script doesn't show the number of fb-page-likes anymore...</p>
  
  <pre><code>$ch = curl_init("http://graph.facebook.com/FACEBOOKPAGE");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $raw = curl_exec($ch);
  curl_close($ch);
  $data = json_decode($raw);
  $scm_fb = $data-&gt;likes;
  echo $scm_fb;
  </code></pre>
  
  <p>I tried also the following code, but this also displays nothing... </p>
  
  <pre><code>$page_id = "FACEBOOKPAGE"; 
  $likes = 0; //Initialize the count
  
  //Construct a Facebook URL
  $json_url ='https://graph.facebook.com/'.$page_id.'';
  $json = file_get_contents($json_url);
  $json_output = json_decode($json);
  
  //Extract the likes count from the JSON object
  if($json_output-&gt;likes){
      $likes = $json_output-&gt;likes;
  }
  </code></pre>
  
  <p>(I also tried the Facebook-Page-ID instead of the pagename, result is the same)</p>
  
  <p>any suggestions?</p>