首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP类今天完全忘记了一些事情-对不起

PHP类今天完全忘记了一些事情-对不起
EN

Stack Overflow用户
提问于 2010-06-10 15:57:44
回答 1查看 81关注 0票数 0

真的很抱歉,我今天太胖了,但是我忘记了怎么做一些简单的事情--最近太多时间不在php里了。

想要使用操作系统phpapi如何打印出单独的行-请看,我告诉过你我今天很胖

代码语言:javascript
复制
 // The fields we will be fetching.


 if (isset($_GET['test']) && $_GET['test'] == 'plaxo') {
    // plaxo is a PortableContacts end-point so doesn't know about the OpenSocial specific fields
    $profile_fields = array();
  } else {
    $profile_fields = array(
        'aboutMe',
        'displayName',
        'bodyType',
        'currentLocation',
        'drinker',
        'happiestWhen',
        'lookingFor'
    );
  }

//拉取的好友数量

代码语言:javascript
复制
  $friend_count = 2;

$batch = $osapi->newBatch();
    // Fetch the current user.
      $self_request_params = array(
          'userId' => $userId,              // Person we are fetching.
          'groupId' => '@self',             // @self for one person.
          'fields' => $profile_fields       // Which profile fields to request.
      );
  $batch->add($osapi->people->get($self_request_params), 'self');

  // Fetch the friends of the user
  $friends_request_params = array(
      'userId' => $userId,              // Person whose friends we are fetching.
      'groupId' => '@friends',          // @friends for the Friends group.
      'fields' => $profile_fields,      // Which profile fields to request.
      'count' => $friend_count          // Max friends to fetch.
  );
  $batch->add($osapi->people->get($friends_request_params), 'friends');

  // Get supportedFields Request
  $batch->add($osapi->people->getSupportedFields(), 'supportedFields');

  // Send the batch request.
  $result = $batch->execute();

假设我想打印出"aboutMe",得到的回声是什么?因为回显$result‘’aboutMe‘不起作用。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-06-10 16:05:20

虽然我不是php专家,而且我对你使用的具体产品一无所知,但我发现使用var_dump($result)对调试有很大的帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3012609

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档