웹솔루션개발 22년 노하우! 해피CGI의 모든것

[해피CGI][cgimall] email 존재 유무 체크 함수 본문

웹프로그램밍 자료실/알짜자료 골드팁

[해피CGI][cgimall] email 존재 유무 체크 함수

해피CGI윤실장 2017. 5. 12. 09:50
function email_check($email) {
if (!eregi("^[a-z0-9]+([\.%!][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$", $email)) {
$return = false;
} else {
list($user, $host) = explode("@", $email);
if (checkdnsrr($host, "MX") or checkdnsrr($host, "A")) {
$return = true;
} else {
$return = false;
}
}
return $return;
}


자료출처 : http://www.tegi.org

 

홈페이지바로가기 

Comments