Validate Email in php. Simple php function to validate email address.
function validateEmail($email) {
if(preg_match("~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~",$email)) {
return true;
} else {
return false;
}
}
function validateEmail($email) {
if(preg_match("~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~",$email)) {
return true;
} else {
return false;
}
}
No comments:
Post a Comment