0

如何在这个数组中获取键user_login的值email

我尝试了所有喜欢foreach的 , array keysarray['user_login']但没有得到值。

我在wordpress工作。print_r像这样打印数组数据

$array=$_SESSION;
print_r($array);

数组 ( [userdata] => __PHP_Incomplete_Class 对象 ( [__PHP_Incomplete_Class_Name] => WP_User [data] => stdClass 对象 ( [ID] => 1 [user_login] => admin [user_pass] => $P$BZzVW3B4g2f6pgocN3iu9h4J0CFmCj1 [user_nicename] => admin [user_email] => abc@gmail.com [user_url] => [user_registered] => 2013-05-22 02:21:09 [user_activation_key] => [user_status] => 0 [display_name] => admin ) [ ID] => 1 [caps] => Array ([administrator] => 1) [cap_key] => wp_capabilities [roles] => Array ([0] => administrator) [allcaps] => Array ([switch_themes] = > 1 [edit_themes] => 1 [activate_plugins] => 1 [edit_plugins] => 1 [edit_users] => 1 [edit_files] => 1 [manage_options] => 1 [moderate_comments] => 1 [manage_categories] => 1 [管理链接] =>1 [upload_files] => 1 [import] => 1 [unfiltered_html] => 1 [edit_posts] => 1 [edit_others_posts] => 1 [edit_published_posts] => 1 [publish_posts] => 1 [edit_pages] => 1 [读] => 1 [level_10] => 1 [level_9] => 1 [level_8] => 1 [level_7] => 1 [level_6] => 1 [level_5] => 1 [level_4] => 1 [level_3] => 1 [level_2] => 1 [level_1] => 1 [level_0] => 1 [edit_others_pages] => 1 [edit_published_pa​​ges] => 1 [publish_pages] => 1 [delete_pages] => 1 [delete_others_pages] => 1 [delete_published_pa​​ges] => 1 [delete_posts] => 1 [delete_others_posts] => 1 [delete_published_posts] => 1 [delete_private_posts] => 1 [edit_private_posts] => 1 [read_private_posts] => 1 [delete_private_pages] => 1 [ edit_private_pages] => 1 [read_private_pages] =>1 [delete_users] => 1 [create_users] => 1 [unfiltered_upload] => 1 [edit_dashboard] => 1 [update_plugins] => 1 [delete_plugins] => 1 [install_plugins] => 1 [update_themes] => 1 [ install_themes] => 1 [update_core] => 1 [list_users] => 1 [remove_users] => 1 [add_users] => 1 [promote_users] => 1 [edit_theme_options] => 1 [delete_themes] => 1 [export] => 1 [simple_tags] => 1 [admin_simple_tags] => 1 [管理员] => 1 ) [过滤器] => ) )1 [edit_theme_options] => 1 [delete_themes] => 1 [export] => 1 [simple_tags] => 1 [admin_simple_tags] => 1 [administrator] => 1 ) [filter] => ) )1 [edit_theme_options] => 1 [delete_themes] => 1 [export] => 1 [simple_tags] => 1 [admin_simple_tags] => 1 [administrator] => 1 ) [filter] => ) )

4

1 回答 1

0

你试过了吗

$_SESSION>userdata('user_login');

要检索您的 user_login?

于 2013-06-05T11:55:21.127 回答