PHP - Email Validation

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=')
- Function that checks for a valid email returns 0 if false and 1 if true

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.