This article introduces a custom function, which is about determining whether it is a valid email address. In fact, it is what we often call regular verification of email addresses. If you are interested, take a look.
The code is as follows
代码如下 |
复制代码 |
// 函数名:CheckEmailAddr($C_mailaddr)
// 作 用:判断是否为有效邮件地址
// 参 数:$C_mailaddr(待检测的邮件地址)
// 返回值:布尔值
// 备 注:无
function CheckEmailAddr($C_mailaddr)
{
if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$",
$C_mailaddr))
//(!ereg("^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*$",
$c_mailaddr))
{
return false;
}
return true;
}
|
|
Copy code |
|
// Function name: CheckEmailAddr($C_mailaddr)
// Function: Determine whether it is a valid email address
// Parameter: $C_mailaddr (email address to be detected)
//Return value: Boolean value
// Remarks: None
function CheckEmailAddr($C_mailaddr)
{
if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9 -]+)*$",
$C_mailaddr))
//(!ereg("^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@[_a-zA-Z0-9-]+( .[_a-zA-Z0-9-]+)*$",$c_mailaddr))
{
return false;
}
return true;
}
http://www.bkjia.com/PHPjc/631663.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631663.htmlTechArticleThis article introduces a custom function, which is about determining whether it is a valid email address. In fact, it is what we often call regularity Your email address has been verified. If you want to see it, please take a look. Code...