📜  php array_walk_recursive - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:43.599000             🧑  作者: Mango

代码示例1
$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]]