public function valid_email(string $str = null): bool
	{
		if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches))
		{
			$str = $matches[1] . '@' . idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46);
		}

		return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);
	}
public function valid_email(string $str = null): bool
	{
		if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches))
		{
			$str = $matches[1] . '@' . idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46);
		}

		return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);
	}
public function valid_email ( string $ str = null ) : bool { if ( function_exists ( 'idn_to_ascii' ) && defined ( 'INTL_IDNA_VARIANT_UTS46' ) && preg_match ( '#\A([^@]+)@(.+)\z#' , $ str , $ matches ) ) { $ str = $ matches [ 1 ] . '@' . idn_to_ascii ( $ matches [ 2 ] , 0 , INTL_IDNA_VARIANT_UTS46 ) ; } return ( bool ) filter_var ( $ str , FILTER_VALIDATE_EMAIL ) ; }
Checks for a correctly formatted email address

@param string

@return boolean
Checks for a correctly formatted email address