Hello everyone
i wonder if there is a way in php that enables me to merge 2 arrays replacing the similar values
what i mean is this
[php]<
$array1 = array( 0 => 10, 1 => 20);
$array2 = array( 0 => 20, 2 => 30);
$merge = array_merge_recursive($array1, $array2);
print_r($merge);
[/php]
the output of that would be :
Array ( [0] => 10 [1] => 20 [2] => 20 [3] => 30 )
is there a way that i can make it something like :
Array ( [0] => 10 [1] => 20 [2] => 30)
like if an array exists in both arrays it gets ‘fused’ instead of having 2 of it in the merged array.