The php-Arrays function-array_merge_recursive-recursively merges one or more Arrays. Array_merge_recursive () recursively merges one or more arrays [function] This function combines the units of one or more arrays. the values of an array are appended to the values of the previous array. array_merge_recursive () recursively merge one or more arrays
[Function]
This function combines the units of one or more arrays. the values of an array are appended to the values of the previous array.
Returns an array of results. If the input array has the same string key name, these values will be merged into
In the array, this will be recursive, so if a value itself is an array, the function will merge it according to the corresponding entries
Is another array. However, if the array has the same key name, the last value will not overwrite the original value.
Is appended to the backend.
Scope of use]
Php4> 4.0.1, php5.
[Use]
Array array_merge_recursive (array array1 [, array...])
Arrayn/required/array to be used for merging
[Example]
[Php]
$ Arr1 = array ("color" => array ("favorite" => "red"), 5 );
$ Arr2 = array (10, "color" => array ("favorite" => "green", "blue "));
Var_dump (array_merge_recursive ($ arr1, $ arr2 ));
/*
Array (3 ){
["Color"] =>
Array (2 ){
["Favorite"] =>
Array (2 ){
[0] =>
String (3) "red"
[1] =>
String (5) "green"
}
[0] =>
String (4) "blue"
}
[0] =>
Int (5)
[1] =>
Int (10)
}
*/
Taken from zuodefeng's note
Http://www.bkjia.com/PHPjc/478215.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478215.htmlTechArticlearray_merge_recursive () recursively merges one or more arrays [function] This function combines the units of one or more arrays, the values of an array are appended to the back of the previous array...