You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
514 B
17 lines
514 B
<?php |
|
|
|
if (! function_exists('array_merge_recursive_distinct')) { |
|
function array_merge_recursive_distinct(array &$array1, array &$array2) |
|
{ |
|
$merged = $array1; |
|
foreach ($array2 as $key => &$value) { |
|
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { |
|
$merged[$key] = array_merge_recursive_distinct($merged[$key], $value); |
|
} else { |
|
$merged[$key] = $value; |
|
} |
|
} |
|
|
|
return $merged; |
|
} |
|
}
|
|
|