array_merge

PHP 4, PHP 5, PHP 7, PHP 8
array_merge - Merge one or more arrays

Example #1 array_merge example

Result: Array ( [color] => green [0] => 2 [1] => 4 [2] => a [3] => b [shape] => trapezoid [4] => 4 )
PHP Version:

Example #2 array_merge with non-array types

Result: Array ( [0] => foo [1] => bar )
PHP Version:

Example #3 Simple array_merge example

Result: Array ( [0] => data )
PHP Version:


Example #4 of array_merge

PHP Version:


Function array_merge:

Arrays Functions

Most used PHP functions