Validate Email Address Script

Validate Email Address Script is use to validate a email through regular expression.

Demo :



Email :    

Example :

Just type a proper email address like this joe@gmail.com and click check button Is a properly-formatted e-mail address message will display otherwise type a joe name at textbox and click check button Is an improperly-formatted e-mail address message will display here.

Code :

Following code is use to Validate Email Address Script if you need to copy and use to your website.


<?php
  function validateEmailAddress($str)
  {
    return eregi("^([a-z0-9_-])+([\.a-z0-9_-])*@([a-z0-9-])+(\.[a-z0-9-]+)*\.([a-z]{2,6})$", $str);
  }
  $email_id = "joe@some.domain.com";
  echo validateEmailAddress($email_id) ? "Is a properly-formatted e-mail address" : "Is an improperly-formatted e-mail address";
?>

The E-mail address validation is one of the most common types of input validation. In the above $email_id variable is use to assign the email address. In the validateEmailAddress() function is use to check the validate email through regular expression.

Free Download Script :

If you need to Validate Email Script click and download from following link.

Download




Content