This article mainly introduces how to use the array_merge () function to merge correlated and non-correlated arrays in php. It involves the array merging technique of the array_merge () function in php. For more information, see
This article mainly introduces how to use the array_merge () function to merge correlated and non-correlated arrays in php. It involves the array merging technique of the array_merge () function in php. For more information, see
This example describes how to use the array_merge () function to merge correlated and non-correlated arrays in php. Share it with you for your reference. The specific analysis is as follows:
Array_merge () is a php function used to merge arrays. The last array is appended to the ending position of the previous one and the merged result array is returned.
<? Php $ beginning = 'foo'; $ end = array (1 => 'bar'); $ result = array_merge (array) $ beginning, (array) $ end ); print_r ($ result);?>
The output result is as follows:
Array ([0] => foo [1] => bar)
I hope this article will help you with php programming.