Source Code:
(back to article)
<?php $array1 = array(1, 2, 3); $array2 = array(4, 5, 6); foreach ($array2 as $element) { $array1[] = $element; } print_r($array1); // $array1 is now [1, 2, 3, 4, 5, 6]
Result:
Report an issue