$data = array(
'a' => array(
'b' => array(
'c' => 'c',
'd' => 'd'
)
)
);
foreach($data as $k => $v){
foreach ($v as $i => $j) {
$data[$k][$i]['new'] = 'new'; // 给最里面的 b 数组增加一个 new 值
}
}
// 结果变为:
$data = array(
'a' => array(
'b' => array(
'c' => 'c',
'd' => 'd',
'new' => 'new'
)
)
);