php email validation

Written By smart| 8 July 2009| No Comment

Many email address validation will actually throw up errors when faced with a valid, but unusual email address  for example that an email address with a domain name extension of more than three letters is invalid.

if((!ereg("[a-zA-Z0-9]+[\w{0}|\.|\-|_]+@[a-zA-Z0-9]+\.[a-zA-z]{2,4}$", $ email))
{
   $email_error = 'set error message';
}
Related Posts with Thumbnails

Share With Others

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.