Write a simple PHP program to check that emails are valid.
<?php // pass valid/invalid emails $email = "mail@example.com"; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo '"' . $email . '" = Valid'."\n"; } else { echo '"' . $email . '" = Invalid'."\n"; } ?>
Sample Output:
"mail@example.com" = Valid
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer