【问题标题】:get application user's info - Facebook-GRAPH API-PHP SDK获取应用程序用户信息 - Facebook-GRAPH API-PHP SDK
【发布时间】:2011-04-11 15:40:14
【问题描述】:

我需要转储应用程序用户的一些信息 我正在使用此代码!

$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);

但这仅显示名称,没有其他内容! 为什么?

【问题讨论】:

    标签: facebook facebook-graph-api facebook-php-sdk


    【解决方案1】:

    您正在编造属性名称。不是性,是性。等等。阅读:http://developers.facebook.com/docs/reference/api/user/

    【讨论】:

      【解决方案2】:
          $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']."' />";     
          }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-08-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多