如何向现有数组添加元素?我有数组:
Array ( [0] => Array ( [user_id] => 1 [user_login] => Saibamen [user_password] => 4028a0e356acc947fcd2bfshfh3w26gdshhbf00cef11e128d484a [user_email] => [email protected] /cdn-cgi/l/email-protection [user_active] => 1 [user_last_login_ip] => 127.0.0.1 [user_perms] => ) )
我想向该数组添加“avatar”参数:
$avatar = md5($array_in_this_question[0]['user_email'])
添加值的方式与读取值时相同:通过使用其键
$array_in_this_question[0]['avatar'] = md5($array_in_this_question[0]['user_email']);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)