Php uses the array_merge () function to merge correlated and non-correlated arrays. Php uses the array_merge () function to merge correlated and non-correlated arrays. This article mainly introduces the php method to merge correlated and non-correlated arrays through the array_merge () function, methods for merging correlated and non-correlated arrays using the array_merge () function of array php in php
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.
?
|
1
2
3
4
5
6 |
$ Beginning = 'foo ';
$ End = array (1 => 'bar ');
$ Result = array_merge (array) $ beginning, (array) $ end );
Print_r ($ result );
?>
|
The output result is as follows:
?
|
1
2
3
4
5 |
Array
(
[0] => foo
[1] => bar
)
|
I hope this article will help you with php programming.
Merge () function merging association and non-correlated array method this article mainly introduces php's method of merging correlated and non-correlated arrays through the array_merge () function, involving array in php...