Is there a way i can replace the values of one array with the values of another which has identical keys?
$arr1 = Array ( [key1] => va
If you need to preserve an order of the array, use array_replace:
$a = array( 'a' => 1, 'b' => 2, 'c' => 3 ); $b = array( 'b' => 20, 'c' => 30 ); $r = array_replace($a, $b) // $r = array( 'a' => 1, 'b' => 20, 'c' => 30 );