判断是否为有效邮件地址

//———————————————————————————–
——-
// 函数名: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;
}
//———————————————————————————–
——-

Popularity: 54%

One Response to “判断是否为有效邮件地址”

commenter

Just landed on this place via Google search. I love it. This situation change my perceptual experience and I am bringing the RSS feeds. Cheers Up.

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>