現在我正在使用PHP解析sdk,並試圖獲取所有用戶信息。PHP解析無法獲取用戶的電子郵件
$query = ParseUser::query();
$objArray = $query->find();
$data = array();
print_r($objArray);
foreach ($objArray as $obj) {
$one['id'] = $obj->getObjectId();
$one['displayName'] = $obj->displayName;
$one['email'] = $obj->email;
$data[]=$one;
}
,這是print_r的結果
Array ([0] => Parse\ParseUser Object ([_sessionToken:protected] => [serverData:protected] => Array ([readreceipt] => YES [pushnotification] => YES [usernameFix] => jodydunn [displayName_lower] => jody dunn [displayName] => jody dunn [firstLaunch] => Yes [username] => [email protected] [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 23404642 [verifiedAccount] => 1) [operationSet:protected] => Array () [estimatedData:Parse\ParseObject:private] => Array ([readreceipt] => YES [pushnotification] => YES [usernameFix] => jodydunn [displayName_lower] => jody dunn [displayName] => jody dunn [firstLaunch] => Yes [username] => [email protected] [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 23404642 [verifiedAccount] => 1) [dataAvailability:Parse\ParseObject:private] => Array ([readreceipt] => 1 [pushnotification] => 1 [usernameFix] => 1 [displayName_lower] => 1 [displayName] => 1 [firstLaunch] => 1 [username] => 1 [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 1 [verifiedAccount] => 1) [className:Parse\ParseObject:private] => _User [objectId:Parse\ParseObject:private] => 97EIKQVlUW [createdAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-30 14:26:15.568000 [timezone_type] => 2 [timezone] => Z) [updatedAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-06-12 23:34:47.234000 [timezone_type] => 2 [timezone] => Z) [hasBeenFetched:Parse\ParseObject:private] => 1) [1] => Parse\ParseUser Object ([_sessionToken:protected] => [serverData:protected] => Array ([username] => [email protected] [displayName_lower] => tiago marques [usernameFix] => tiagomarques [displayName] => Tiago Marques [firstLaunch] => Yes [readreceipt] => YES [pushnotification] => YES [facebookId] => 1722892281374124 [qbUserID] => 23295999) [operationSet:protected] => Array () [estimatedData:Parse\ParseObject:private] => Array ([username] => [email protected] [displayName_lower] => tiago marques [usernameFix] => tiagomarques [displayName] => Tiago Marques [firstLaunch] => Yes [readreceipt] => YES [pushnotification] => YES [facebookId] => 1722892281374124 [qbUserID] => 23295999) [dataAvailability:Parse\ParseObject:private] => Array ([username] => 1 [displayName_lower] => 1 [usernameFix] => 1 [displayName] => 1 [firstLaunch] => 1 [readreceipt] => 1 [pushnotification] => 1 [facebookId] => 1 [qbUserID] => 1) [className:Parse\ParseObject:private] => _User [objectId:Parse\ParseObject:private] => nOsEiFmpLu [createdAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-27 16:11:18.737000 [timezone_type] => 2 [timezone] => Z) [updatedAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-27 16:11:37.865000 [timezone_type] => 2 [timezone] => Z) [hasBeenFetched:Parse\ParseObject:private] => 1) [2] => Parse\ParseUser Object ([_sessionToken:protected] => [serverData:protected] => Array ([displayName_lower] => jody dunn [firstLaunch] => Yes [displayName] => jody dunn [usernameFix] => jodydunn [username] => [email protected] [readreceipt] => YES [pushnotification] => YES [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 23158732 [verifiedAccount] => 1) [operationSet:protected] => Array () [estimatedData:Parse\ParseObject:private] => Array ([displayName_lower] => jody dunn [firstLaunch] => Yes [displayName] => jody dunn [usernameFix] => jodydunn [username] => [email protected] [readreceipt] => YES [pushnotification] => YES [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 23158732 [verifiedAccount] => 1) [dataAvailability:Parse\ParseObject:private] => Array ([displayName_lower] => 1 [firstLaunch] => 1 [displayName] => 1 [usernameFix] => 1 [username] => 1 [readreceipt] => 1 [pushnotification] => 1 [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 1 [verifiedAccount] => 1) [className:Parse\ParseObject:private] => _User [objectId:Parse\ParseObject:private] => VtvElOtqFQ [createdAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-24 11:47:08.461000 [timezone_type] => 2 [timezone] => Z) [updatedAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-06-12 23:34:24.014000 [timezone_type] => 2 [timezone] => Z) [hasBeenFetched:Parse\ParseObject:private] => 1) [3] => Parse\ParseUser Object ([_sessionToken:protected] => [serverData:protected] => Array ([displayName] => Jody dunn [pushnotification] => YES [readreceipt] => YES [username] => [email protected] [firstLaunch] => Yes [usernameFix] => jodydunn [displayName_lower] => jody dunn [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 22885014) [operationSet:protected] => Array () [estimatedData:Parse\ParseObject:private] => Array ([displayName] => Jody dunn [pushnotification] => YES [readreceipt] => YES [username] => [email protected] [firstLaunch] => Yes [usernameFix] => jodydunn [displayName_lower] => jody dunn [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 22885014) [dataAvailability:Parse\ParseObject:private] => Array ([displayName] => 1 [pushnotification] => 1 [readreceipt] => 1 [username] => 1 [firstLaunch] => 1 [usernameFix] => 1 [displayName_lower] => 1 [userAlreadyAutoFollowedFacebookFriends] => 1 [qbUserID] => 1) [className:Parse\ParseObject:private] => _User [objectId:Parse\ParseObject:private] => oBBU5lwrAk [createdAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-17 23:09:42.008000 [timezone_type] => 2 [timezone] => Z) [updatedAt:Parse\ParseObject:private] => DateTime Object ([date] => 2017-01-17 23:09:46.529000 [timezone_type] => 2 [timezone] => Z) [hasBeenFetched:Parse\ParseObject:private] => 1)
這樣我就可以讓其他的領域,但沒有現有的電子郵件。
如何獲得電子郵件。請告訴我。
'print_r($ objArray);'?的輸出是什麼? – Enstage
dunno試試'$ one ['email'] = $ obj-> get('email');',瘋狂的來源https://hotexamples.com/examples/parse/ParseUser/query/php-parseuser-query- method-examples.html –
謝謝@Enstage我在我的帖子 – Alex