array_merge
Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one.
Parameters
main.php
Return Values
array
Returns the resulting array with all arrays merged together
On success:Array with all input arrays merged sequentially
On failure:Empty array if no arrays provided
Notes
- Values with numeric keys will be renumbered with incrementing keys starting from zero
- If input arrays have the same string keys, later values will overwrite the previous ones
- For arrays with only numeric keys, values will not be overwritten
- Function can be called without parameters since PHP 7.4.0
Changelog
- 7.4.0: This function can now be called without any parameter. Formerly, at least one parameter has been required.
Related Functions
implode
StringJoins array elements with a string separator.
joinconcatenatecombine