Merging Arrays in PHP


Combine two arrays into one with array_merge().

Source Code

$array1 = ['a', 'b', 'c'];
$array2 = ['d', 'e', 'f'];
$merged = array_merge($array1, $array2);
print_r($merged);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments