这是为什么?
<?php
/**
* Class UserAction by <admin@zbphp.com>
*/
class UserAction extends InitAction
{
public function index()
{
$where = array(
'mid' => array('eq', $this->getUid())
);
$this->rowUser = M('Member')->where($where)->find();
//测试1
$this->rowUser['ext'] = '名字4';
dump($this->rowUser); //里面没有ext这个键!
//测试2 有
$arr['ext'] = '名字4';
$this->rowUser = array_merge($arr, $this->rowUser);
dump($this->rowUser); //里面有ext这个了
//测试3
$this->rowUser2 = array(
'a' => 'A',
'b' => 'B',
);
$this->rowUser2['ext'] = '3333';
dump($this->rowUser2); //里面也没有ext这个
die;
}
} 最佳答案