public static function merge(array $to, array $from)
    {
        $args = func_get_args();
        $res = array_shift($args);
        while (!empty($args)) {
            $next = array_shift($args);
            foreach ($next as $k => $v) {
                if (is_integer($k)) {
                    isset($res[$k]) ? $res[] = $v : $res[$k] = $v;
                } elseif (is_array($v) && isset($res[$k]) && is_array($res[$k])) {
                    $res[$k] = self::merge($res[$k], $v);
                } else {
                    $res[$k] = $v;
                }
            }
        }
        return $res;
    }
public static function merge(array $to, array $from)
    {
        $args = func_get_args();
        $res = array_shift($args);
        while (!empty($args)) {
            $next = array_shift($args);
            foreach ($next as $k => $v) {
                if (is_integer($k)) {
                    isset($res[$k]) ? $res[] = $v : $res[$k] = $v;
                } elseif (is_array($v) && isset($res[$k]) && is_array($res[$k])) {
                    $res[$k] = self::merge($res[$k], $v);
                } else {
                    $res[$k] = $v;
                }
            }
        }
        return $res;
    }
public static function merge ( array $ to , array $ from ) { $ args = func_get_args ( ) ; $ res = array_shift ( $ args ) ; while ( ! empty ( $ args ) ) { $ next = array_shift ( $ args ) ; foreach ( $ next as $ k => $ v ) { if ( is_integer ( $ k ) ) { isset ( $ res [ $ k ] ) ? $ res [ ] = $ v : $ res [ $ k ] = $ v ; } elseif ( is_array ( $ v ) && isset ( $ res [ $ k ] ) && is_array ( $ res [ $ k ] ) ) { $ res [ $ k ] = self :: merge ( $ res [ $ k ] , $ v ) ; } else { $ res [ $ k ] = $ v ; } } } return $ res ; }
Merges two arrays.
@param array $to array to be merged to.
@param array $from array to be merged from.
@return array the merged array.
Merges two arrays .