Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Zack Williams http://artisancomputer.com

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Validate an email address

I don't remember where this came from, but it's very useful for validating input from a form


function valid_email($email) {

  if( eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) ) { 
    return true;
  }
  else { 
    return false;
  }

}

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed