Untitled
public text v1 · immutable<?php
# Wildhoney's Email Validation Function
# Using regular expression and MX record validation.
function validateEmail($x) {
if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,6}$', $x) === 1) {
list($user, $domain) = split("@", $x);
if(checkdnsrr($domain) === true) {
return 1;
} else {
return 0;
}
} else {
return 0;
}
}
?>