Check for valid email address function

function isValidEmail($email){ return preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $email); } $result = isValidEmail('test@test.com=')
A simple function that checks for a valid email address returns a 1 if true, 0 if not.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.