php filter validate email

Solutions on MaxInterview for php filter validate email by the best coders in the world

showing results for - "php filter validate email"
Casey
12 Feb 2017
1<?php
2$email_a = 'joe@example.com';
3$email_b = 'bogus';
4
5if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
6    echo "L'adresse email '$email_a' est considérée comme valide.";
7}
8if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
9    echo "L'adresse email '$email_b' est considérée comme valide.";
10} else {
11    echo "L'adresse email '$email_b' est considérée comme invalide.";
12}
13?>