title: Is it possible to find Facebook mutual friends using the API?
body: <p>I was wanting to find out if it is possible using the Facebook API or Open Graph and two users ID to out put there mutual friends?</p>
  
  <p>As i have managed to do this but it only lists the mutual friends that are 'playing your game' not the whole list.</p>
  
  <p>bellow is the function i have created:</p>
  
  <pre><code>function getMutualFriends($facebook, $uid1, $uid2,$amount=3){
      $random_ids     = array();
      try {
          $param  =   array(
                      'method'  =&gt; 'friends.getMutualFriends',
                      'source_uid'    =&gt; $uid1,
                      'target_uid'  =&gt; $uid2,
                      'callback'=&gt; ''
                  );
          $mutualFriends   =   $facebook-&gt;api($param);
          if(count($mutualFriends) &lt; $amount){
              $amount = count($mutualFriends);
          }
          $random = pickrandom($mutualFriends,$amount);
  
          for($i=0; $i&lt;$amount; $i++){
              $random_ids[] = get_name($random[$i]);
          }
          $output = implode(",\n", $random_ids);
          print_r($output);
      //  print_r($mutualFriends);
  
      }
      catch(Exception $o) {
          print_r($o);
      }
     // return 'None';
  }
  </code></pre>