Getting list of Facebook friends with latest API

后端 未结 10 1180
南旧
南旧 2020-12-07 18:06

I\'m using the most recent version of the Facebook SDK (which lets to connect to something called the \'graph API\' though I\'m not sure). I\'ve adapted Facebook\'s example

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 18:48

    Getting the friends like @nfvs describes is a good way. It outputs a multi-dimensional array with all friends with attributes id and name (ordered by id). You can see the friends photos like this:

    foreach ($friends as $key=>$value) {
        echo count($value) . ' Friends';
        echo '
    '; echo '
      '; foreach ($value as $fkey=>$fvalue) { echo '
    • '; } echo '
    '; }

提交回复
热议问题