Voting

: min(two, seven)?
(Example: nine)

The Note You're Voting On

andyidol at gmail dot com
14 years ago
Here's my function to recursively merge two arrays with overwrites. Nice for merging configurations.

<?php

function MergeArrays($Arr1, $Arr2)
{
foreach(
$Arr2 as $key => $Value)
{
if(
array_key_exists($key, $Arr1) && is_array($Value))
$Arr1[$key] = MergeArrays($Arr1[$key], $Arr2[$key]);

else
$Arr1[$key] = $Value;

}

return
$Arr1;

}

?>

<< Back to user notes page

To Top