What are some built-in PHP functions that can be used to merge arrays?
To merge arrays in PHP, you can use the array_merge() function. This function takes two or more arrays as arguments and returns a new array containing all the elements from the input arrays. It is a simple and efficient way to combine arrays without worrying about duplicate keys.
$array1 = [1, 2, 3];
$array2 = [4, 5, 6];
$mergedArray = array_merge($array1, $array2);
print_r($mergedArray);