Source Code:
(back to article)
<?php $arr1 = [1, 2]; $arr2 = [3, 4]; // arr2 elements are being pushed in the arr1. array_push($arr1, ...$arr2); echo "arr1 = "; // Using the for each loop to print all the array elements. foreach ($arr1 as $value) { echo $value . ' '; } ?>
Result:
Report an issue