title: How do I get the total number of friends using the Facebook API and PHP?
body: <p>How can I get the total number of friends using the Facebook PHP API? </p>
  
  <p>This is my code so far:</p>
  
  <pre><code>&lt;?php require_once 'facebook.php'; 
    $appapikey = 'x'; 
    $appsecret = 'x'; 
    $facebook = new Facebook($appapikey, $appsecret);
    $user_id = $facebook-&gt;getuser(); $friends = ???; 
  </code></pre>