Advertisement
Guest User

Mike Knoop

a guest
Jun 24th, 2009
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // Code to be placed into your facebookapi_php5_restlib.php file.
  2. /**
  3. * Returns an array of mutual friends between the source and target
  4. *
  5. * @param int $uid1 Source UID
  6. * @param int $uid2 Target UID
  7. *
  8. * @return array An array of friends
  9. */
  10. public function &friends_getMutualFriends($uid1=null, $uid2 = null) {
  11. return $this->call_method('facebook.friends.getMutualFriends',
  12. array('target_uid' => $uid1,
  13. 'source_uid' => $uid2));
  14.  
  15. }
  16. // end
  17.  
  18.  
  19. // Code to utilize the above call
  20. $friends = $GLOBALS['Facebook']->api_client->friends_getMutualFriends('4', $_POST['fb_sig_user']);
  21. $count = count($friends);
  22.  
  23. echo "You have $count friends in common.<br />";
  24. print_r($friends);
  25. // end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement