Here is my code:
$arr1 = ['p' => 2, 'pm' => 1];
$arr2 = ['p' => ''];
print_r(array_merge($arr1, $arr2));
And here is the current output:
Array
(
[p] =>
[pm] => 1
)
And here the expected result:
Array
(
[pm] => 1
[p] =>
)
Because the send array ($arr2
) in array_merge()
contains p
key, so I want to put it in the end. Any idea how can I do that?