由于erigi()
在PHP 5中已弃用,我需要验证电子邮件ID,因此应该使用哪个函数...?进一步请给电子邮件验证,如格式:PHP erigi:贬值(电子邮件验证)
<?php
function checkEmail($email)
{
if(eregi("^[a-zA-Z0-9_][email protected][a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))
{
return FALSE;
}
list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
?>