【发布时间】:2014-08-04 17:33:48
【问题描述】:
我想使用 yahoo api 获取用户 yahoo 联系人并在页面中显示我的代码:
// if a session is initialized, fetch the user's profile information
if($session) {
// Get the currently sessioned user.
$user = $session->getSessionedUser();
//var_dump($user);
// Load the profile for the current user.
$profile = $user->getProfile();
$profile_contacts=XmltoArray($user->getContactSync());
var_dump( $profile_contacts);
$contacts=array();
foreach($profile_contacts['contactsync']['contacts'] as $key=>$profileContact){
foreach($profileContact['fields'] as $contact){
$contacts[$key][$contact['type']]=$contact['value'];
}
}
//echo "<pre/>";
//print_r($contacts);exit;
}
但是 $contact 是空的,我不知道请帮忙
【问题讨论】: