Validate Email ID Using PHP

by Geethalakshmi 2012-06-15 15:06:09

Validate Email ID Using PHP


$email = $_POST['email'];
if(preg_match("~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~",$email)) {
echo 'This is a valid email.';
} else{
echo 'This is an invalid email.';
}
498
like
0
dislike
0
mail
flag

You must LOGIN to add comments