What is a best practice for merging two arrays in PHP while preserving the order of elements?

When merging two arrays in PHP while preserving the order of elements, a common best practice is to use the `array_merge` function followed by the `array_unique` function. This combination ensures that the order of elements from both arrays is maintained, and any duplicate values are removed.

$array1 = [1, 2, 3, 4];
$array2 = [3, 4, 5, 6];

$mergedArray = array_unique(array_merge($array1, $array2));

print_r($mergedArray);