function merge_array($arr1, $arr2) { foreach ($arr1 as $k => $v) { if (isset($arr2[$k])) { if (is_array($arr1[$k]) && is_array($arr2[$k])) { $arr2[$k] = T3Common::merge_array($arr1[$k], $arr2[$k]); } } else { $arr2[$k] = $arr1[$k]; } } return $arr2; }