📅  最后修改于: 2022-03-11 14:53:43.599000             🧑  作者: Mango
$arr = array(1, array(2, 3));
// Call function on every item, even subarrays.
// Sign $item as reference to work on original item.
array_walk_recursive($arr, function(&$item, $key, $myParam){
$item *= 2;
}, 'will be in myParam');
// $arr now is [2, [4, 6]]