Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

PHP Email Validation Function

DZone's Guide to

PHP Email Validation Function

·
Free Resource
// 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;
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}