0

「今日は完全に厚い」ことについて本当に申し訳ありませんが、私は何か簡単なことをする方法を忘れました-最近のphpではあまりにも多くの時間があります。

OS phpapiを使用したい個々の行を印刷するにはどうすればよいですか?今日は太っていたと言われています

 // 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'
    );
  }

//フェッチする友達の数。

  $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」を印刷したいとしましょう。エコーは何ですか?cos echo $result['aboutMe']は機能しません。

4

1 に答える 1

1

私は PHP の専門家とはほど遠く、あなたが使用している特定の製品について何も知らないことは確かですが、使用var_dump($result)するとデバッグに大いに役立つことがわかります。

于 2010-06-10T08:05:20.153 に答える