Webmaster Forums

Full Version: Validate Email address with PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have my website completely made in PHP. But I m stuck in the Email address validation. How can i do that with PHP

More Info
webmyne.com
Easy way is with a regex expression and preg_match, e.g.

Code:
if(!preg_match("/^[A-Z0-9._%-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i", $email)) {
    // address doesn't match format
}

but not 100%
Reference URL's