In a piece of software, I merge two arrays with
$A = array('a' => 1, 'b' => 2, 'c' => 3);
$B = array('c' => 4, 'd'=> 5);
[a] => 1 [b] => 2 [c] => 4 [d] => 5
'c' => 3
You need to use array_merge_recursive instead of array_merge. Of course there can only be one key equal to 'c' in the array, but the associated value will be an array containing both 3 and 4.
See it in action.