DZone 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
PHP Email Validation Function
// Simple function to check if an given email adddress is valid
function is_valid_email($email) {
$result = TRUE;
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) {
$result = FALSE;
}
return $result;
}





Comments
Snippets Manager replied on Fri, 2010/04/09 - 1:37pm
Snippets Manager replied on Tue, 2009/01/27 - 9:46am