0
真的很抱歉「今天很累」,但我忘記了如何做一些簡單的事情 - 太多時間不在PHP最近。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']不起作用。
我不知道有問題的產品,但是您可以通過執行'print_r($ result);' – 2010-06-10 07:59:58