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 the keys in array 1 and 2 are identical:
$arr1 = $arr2;
If all keys of array 2 are guaranteed to be in array 1 (array 2 is a subset of array 1):
$arr1 = array_merge($arr1, $arr2);
If some keys of array 2 are not in array 1 and you want only the keys that are in array 1 to be replaced (array 2 is not a subset of array 1, and you only want to merge the intersecting part):
$arr1 = array_merge($arr1, array_intersect_key($arr2, $arr1));