开发者

get application user's info - Facebook-GRAPH API-PHP SDK

i need to dump some info of the application user's i am using this code !

$fbme     =   $facebook->api('/me');
$str = $fbme['name'].' '.$fbme['sex'].' '.$fbme['hometown_location'].' '.$开发者_JAVA技巧fbme['profile_url'].'\r\n';
$fp = fopen("data.txt", "w");
fwrite($fp, $str);
fclose($fp);

but this only shows the name, nothing else ! why ?


You're making up property names. It's not sex, it's gender. And so on. Read: http://developers.facebook.com/docs/reference/api/user/


    $friends = $facebook->api('me/friends');

    //print_r($friends['data']);
    print_r("Number of friends: ". count($friends['data']));

    foreach ($friends['data'] as $key=>$friendList) {
        echo "<br/>".$key." ".$friendList['name']."<img src='https://graph.facebook.com/".$friendList['id']."/picture' width='50' height='50' title='".$friendList['name']."' />";     
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜