public static function email($check, $deep = false, $regex = null)
	{
		if (is_array($check))
		{
			extract(self::_defaults($check));
		}

		if ($regex === null)
		{
			$regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/i';
		}
		$return = self::_check($check, $regex);
		if ($deep === false || $deep === null)
		{
			return $return;
		}

		if ($return === true && preg_match('/@(' . self::$_pattern['hostname'] . ')$/i', $check, $regs))
		{
			if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts))
			{
				return true;
			}
			if (function_exists('checkdnsrr') && checkdnsrr($regs[1], 'MX'))
			{
				return true;
			}
			return is_array(gethostbynamel($regs[1]));
		}
		return false;
	}
public static function email($check, $deep = false, $regex = null)
	{
		if (is_array($check))
		{
			extract(self::_defaults($check));
		}

		if ($regex === null)
		{
			$regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/i';
		}
		$return = self::_check($check, $regex);
		if ($deep === false || $deep === null)
		{
			return $return;
		}

		if ($return === true && preg_match('/@(' . self::$_pattern['hostname'] . ')$/i', $check, $regs))
		{
			if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts))
			{
				return true;
			}
			if (function_exists('checkdnsrr') && checkdnsrr($regs[1], 'MX'))
			{
				return true;
			}
			return is_array(gethostbynamel($regs[1]));
		}
		return false;
	}
public static function email ( $ check , $ deep = false , $ regex = null ) { if ( is_array ( $ check ) ) { extract ( self :: _defaults ( $ check ) ) ; } if ( $ regex === null ) { $ regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self :: $ _pattern [ 'hostname' ] . '$/i' ; } $ return = self :: _check ( $ check , $ regex ) ; if ( $ deep === false || $ deep === null ) { return $ return ; } if ( $ return === true && preg_match ( '/@(' . self :: $ _pattern [ 'hostname' ] . ')$/i' , $ check , $ regs ) ) { if ( function_exists ( 'getmxrr' ) && getmxrr ( $ regs [ 1 ] , $ mxhosts ) ) { return true ; } if ( function_exists ( 'checkdnsrr' ) && checkdnsrr ( $ regs [ 1 ] , 'MX' ) ) { return true ; } return is_array ( gethostbynamel ( $ regs [ 1 ] ) ) ; } return false ; }
Validates for an email address.

Only uses getmxrr() checking for deep validation if PHP 5.3.0+ is used, or
any PHP version on a non-windows distribution

@param   string   $check  Value to check
@param   boolean  $deep   Perform a deeper validation (if true), by also checking availability of host
@param   string   $regex  Regex to use (if none it will use built in regex)
@return  boolean  Success
Validates for an email address .