Check out the Latest Articles:

email-validate-1Often when building applications you need to take care of security specailly when user generated content apps. Spam is our common enemy. To eradicate spam certain filters need to be implemented.

Email validation is one of them. Email validation can stop much of your spam content. Before we get started I would like to tell you that this is much simple funcion that only checks if your email is in proper format i.e email@domain.com. I won’t recommend you to use the same for your applications.

The below function will return false incase the email is not correct and returns the email address if the email address format is correct. Original idea by Regan Johnson

function verify_email($email){
    if(!preg_match('/^[_A-z0-9-]+((.|+)[_A-z0-9-]+)*@[A-z0-9-]+(.[A-z0-9-]+)*(.[A-z]{2,4})$/',$email)){
        return false;
    } else {
        return $email;
    }
}

Related posts:

  1. How to Control A PHP Web Application Remotely
  2. How to remind your visitors to stumble you
  3. 10 Simple ways to protect and secure your PC from Internet Threats
  4. Welcome to MyGeekPal


  1. It‘s quite in here! Why not leave a response?