Sunday, 29 July 2012

Email validation snippet in 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.';
}

Ditulis Oleh : Unknown // 10:52
Kategori:

0 comments:

Post a Comment

 

Followers

Powered by Blogger.