Is there a way i can replace the values of one array with the values of another which has identical keys?
$arr1 = Array
        (
            [key1] => var1
            [key2] => var2
        )
$arr2 = Array
        (
            [key1] => var3
            [key2] => var4
        )
I want to change $arr1's values to the ones in $arr2 im doing this about 10 times, and i can do it line by line, but im wondering if there's a simpler way. Thanks!
Check php's array_merge() function.
$arr1 = array_merge($arr1,$arr2);
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With