简体   繁体   English

我想知道有关PHP中日语电子邮件正则表达式的信息吗?

[英]i want to know about email regular expression for japanese language in php?

Here is my code for to validate email address and this is perfect for my requirement. 这是用于验证电子邮件地址的代码,非常适合我的要求。 but i want to translate this format into Japanese language.Or Tell me such regular expression which used for multiple languages 但我想将此格式翻译成日语。或者告诉我这种用于多种语言的正则表达式

if ( ! function_exists('valid_email')){
function valid_email($address)
{
    return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
}}

Thanks in Advance. 提前致谢。

To validate an email in PHP, use PHP's built in filters. 要使用PHP验证电子邮件,请使用PHP的内置过滤器。 See here for full details: 详细信息请参见此处:

Taken from the above URL, here's an example of how to validate an email: 取自上述网址,这是如何验证电子邮件的示例:

if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
  echo "This ($email_a) email address is considered valid.";
}

Applied to your code, this would make your valid_email() function the following: 应用于您的代码,这将使您的valid_email()函数具有以下功能:

function valid_email($address) 
  return filter_var($address, FILTER_VALIDATE_EMAIL);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM