Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Code to be placed into your facebookapi_php5_restlib.php file.
- /**
- * Returns an array of mutual friends between the source and target
- *
- * @param int $uid1 Source UID
- * @param int $uid2 Target UID
- *
- * @return array An array of friends
- */
- public function &friends_getMutualFriends($uid1=null, $uid2 = null) {
- return $this->call_method('facebook.friends.getMutualFriends',
- array('target_uid' => $uid1,
- 'source_uid' => $uid2));
- }
- // end
- // Code to utilize the above call
- $friends = $GLOBALS['Facebook']->api_client->friends_getMutualFriends('4', $_POST['fb_sig_user']);
- $count = count($friends);
- echo "You have $count friends in common.<br />";
- print_r($friends);
- // end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement