用PHP迭代facebook上的好友列表

用PHP迭代facebook上的好友列表,php,facebook,Php,Facebook,如何在PHP中迭代id为123的facebook用户朋友列表的id?使用api,例如: $result = $facebook->api('/'.$uid.'/friends?fields=name,gender',array('access_token' => $access_token)); 结交一大批朋友 现在,为了查看它们,您需要访问每个项目中的好友数据,如下所示: foreach($result['data'] as $key => $friend){

如何在PHP中迭代id为123的facebook用户朋友列表的id?

使用api,例如:

 $result = $facebook->api('/'.$uid.'/friends?fields=name,gender',array('access_token' => $access_token)); 
结交一大批朋友

现在,为了查看它们,您需要访问每个项目中的好友数据,如下所示:

foreach($result['data'] as $key => $friend){
             //access any data item you want, such as ['id']...  

            }

我希望这有助于……

您最好从FB API基础知识开始:用于查找Facebook上事物之间的连接。您应该从这里开始。对于好友ID 123,只需替换$uid:)