2011-04-11 111 views
-1

我需要轉儲應用程序用戶的一些信息 我正在使用此代碼!獲取應用程序用戶信息 - Facebook-GRAPH API-PHP SDK

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

但這隻顯示名稱,沒有別的! 爲什麼?

回答

0
$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']."' />";  
    } 
相關問題