PHP array_merge() Function

The array_merge() function merges one or more arrays into one array.

If the input arrays have matching string keys, then the later value will override it’s the previous counterpart. If the input arrays contain numeric keys, the later value will be appended instead of overriding the original value. If there is only one array, the array is numerically indexed, the keys get reindexed in a continuous way.

Parameter Description
array1 Required. Specifies an array
array2 Optional. Specifies an array
array3,… Optional. Specifies an array






Array ( [a] => Cooper [b] => Prince [c] => Alex ) 

Leave a Reply

Your email address will not be published. Required fields are marked *