I have two arrays in php as shown in the code
<?php $a=array('0'=>array('500'=>'1','502'=>'2')); $b=array('0'=>array('503'=>'3','504'=>'5')); print_r(array_merge($a[0],$b[0])); ?>
I need to combine two arrays. The array_merge function successfully combined the two of them, but the key value has changed. I need the following output
Array ( [0]=>Array( [500] => 1 [502] => 2 [503] => 3 [504] => 5 ) )
What function can I use in php to get the following result without changing key values?
arrays php
Ganesh babu
source share