使用域名检查电子邮件有效性
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用域名检查电子邮件有效性相关的知识,希望对你有一定的参考价值。
Check the email validity with filter_var and checkdnsfunction checkEmail($email) {
$validate = filter_var($email, FILTER_VALIDATE_EMAIL
); if ($validate) {
return array('errors' => false, 'message' => 'good email'); } else {
return array('errors' => true, 'message' => "Domain name for email doesn't exist"); }
} else {
return array('errors' => true, 'message' => "Invalid email"); }
}
以上是关于使用域名检查电子邮件有效性的主要内容,如果未能解决你的问题,请参考以下文章