话不多说,直接上代码
// 如果你需要这样写
foreach ($arr as &$item) {
$item['a'] = 'a';
}
// 若后续还会遍历此数组,为了避免因引用对后面的影响,最好转成这样写
array_walk($arr, function (&$item) {
$item['a'] = 'a';
});
完
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!