38 of 110 menu

PHP Array Merging

To merge arrays in PHP, use the array_merge function. See the example:

<?php $arr1 = [1, 2, 3]; $arr2 = ['a', 'b', 'c']; $arr = array_merge($arr1, $arr2) var_dump($arr); ?>

Code execution result:

[1, 2, 3, 'a', 'b', 'c']
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline