Snippet Name: Validate email address one Description: Validates an email address format. Also see:» Send iCal Email Meeting Requests using... » Is email deliverable? » Email attachments with PHP mail() » Email with 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 #2 Comment: (none) Language: PHP Highlight Mode: PHP Last Modified: March 16th, 2009
Description: Validates an email address format.
Also see:» Send iCal Email Meeting Requests using... » Is email deliverable? » Email attachments with PHP mail() » Email with 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 #2
<?PHP $email = "[email protected]"; IF(EREGI("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) { ECHO "Valid email address."; }ELSE{ ECHO "Invalid email address."; } ?>