Write a PHP program to valid an email address.
<?php function valid_email($email) { $result = trim($email); if (filter_var($result, FILTER_VALIDATE_EMAIL)) { return "true"; } else { echo "false"; } } echo valid_email("abc@example.com")."\n"; echo valid_email("abc#example.com")."\n"; ?>
Sample Output:
true false
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