CoderZone.org

Category: >> PHP Code >> Validate email address #2 Bookmark and Share

<< lastnext >>

Snippet Name: Validate email address #2

Description: Validates an email address format.

Also see:
» Transfer or migrate messages betwe...
» Easy way to break apart an email a...
» Send iCal Email Meeting Requests u...
» Is email deliverable?
» Email attachments with PHP mail()
» Email w/ attachments class
» Heavy-duty SendMail function
» Use SendMail
» Automatically process email
» Live validation of email address
» Fake email addresses
» Validate email address #3
» Validate email address #1

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: December 08th, 2010

<?php
 
function  checkEmail($email) {
 if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)) {
  return false;
 }
 return true;
}
 
?>
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 4