Yet another PHP email validator

function IsValidEmail ($address) {

	return (preg_match(
		'/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+'.   // the user name
		'@'.                                     // at-sign
		'([-0-9A-Z]+\.)+' .                      // host, sub, and domain names
		'([0-9A-Z]){2,4}$/i',                    // top-level domain
		trim($address)));
}
Leave a comment
Name
Email (optional)
Your email will only be used to show your Gravatar and to send you replies to this article (if you opt to receive them). You won't get ANY other messages at all!
Comment
No HTML allowed
Notify me via email
 
 
Share

Valid HTML 4.01 Strict