Validating Email Addresses in PHP


Use filters to validate email addresses for proper format.

Source Code

$email = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($email === false) {
    echo "Invalid email!";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments