1.函数的作用:比较键值,递归的替代数组中的元素
2.函数的参数:
@params array $array1
@params array $array2
@params array $array3
...
3.例子:
1 <?php 2 $arr1 = [ 3 'a' => 1, 4 'b' => 5 ['a' => 2], 6 'c' => 3, 7 'e' => 7, 8 ]; 9 10 $arr2 = [ 11 'a' => 3, 12 'b' => 4, 13 'c' => 14 ['d' => 5], 15 'd' => 6, 16 ]; 17 print_r(array_replace_recursive($arr1,$arr2));