Conditions | 5 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
4 | function array_merge_recursive_distinct(array &$array1, array &$array2) |
||
5 | { |
||
6 | $merged = $array1; |
||
7 | foreach ($array2 as $key => &$value) { |
||
8 | if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { |
||
9 | $merged[$key] = array_merge_recursive_distinct($merged[$key], $value); |
||
10 | } else { |
||
11 | $merged[$key] = $value; |
||
12 | } |
||
13 | } |
||
14 | |||
15 | return $merged; |
||
16 | } |
||
17 | } |
||
18 |