/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /** * This function validates an email address, returning an integer * depending on whether or not the email address provided is valid. * A positive match will yield a result of 1, while a negative match * will yield a result of 0. FALSE will be returned if an error occurred. * * @param string $email The email address to validate. * @return integer The result of the validation. */ function isValidEmail( $email = null ) { [\d\w\/+!=#|$?%{^&}*`'~-] [\d\w\/\.+!=#|$?%{^&}*`'~-]*@ [A-Z0-9] [A-Z0-9.-]{1,61} [A-Z0-9]\. [A-Z]{2,6}$/ix", $email ); } ?>
Comments
