Does it matter in what order the keys in an array array doing an array_merge, i.e. would the keys in the second array below override the keys in the first array:
array1 = array('username' => 'abc', 'level' => 'admin', 'status' => 'active');
array2 = array('level' => 'root', 'status' => 'active', 'username' => 'bcd');
? Or would the order of the keys have to be the same in the two arrays?
The manual states the answer to this question:
So, yes the keys in the second array will overwrite the keys from the first one if the second array contains some of the same keys.
Output:
So you can see that the keys from the second array overwrote the same keys from first one; the order of the keys in each array does not matter.