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
Simply use the replace function.
$arr1 = array_replace($arr1, $arr2);
or better of if you want to deal with multi-dimensional array, use recursive replace.
$arr1 = array_replace_recursive($arr1, $arr2);
For details check these links array_replace(), array_replace_recursive()