Home / PHP Tips Generated By ChatGPT / Merging Two Arrays in PHP Combine two arrays into one with array_merge(). Source Code $array1 = ["apple", "banana"]; $array2 = ["cherry", "date"]; $merged = array_merge($array1, $array2); print_r($merged); // Combines the two arrays