public static function merge($array1, $array2, $recursive = false)
    {
        if (!self::isValid($array1) ||
            !self::isValid($array2)) {
            return false;
        }

        if ($recursive) {
            return array_merge_recursive($array1, $array2);
        } else {
            return array_merge($array1, $array2);
        }
    }
public static function merge($array1, $array2, $recursive = false)
    {
        if (!self::isValid($array1) ||
            !self::isValid($array2)) {
            return false;
        }

        if ($recursive) {
            return array_merge_recursive($array1, $array2);
        } else {
            return array_merge($array1, $array2);
        }
    }
public static function merge ( $ array1 , $ array2 , $ recursive = false ) { if ( ! self :: isValid ( $ array1 ) || ! self :: isValid ( $ array2 ) ) { return false ; } if ( $ recursive ) { return array_merge_recursive ( $ array1 , $ array2 ) ; } else { return array_merge ( $ array1 , $ array2 ) ; } }
Merge 2 arrays

@param array $array1    First array
@param array $array2    Second array
@param bool  $recursive Recursive

@return array
Merge 2 arrays