Source Code:
(back to article)
<?php $name = "12 Jone"; if (!preg_match("/^[a-zA-Z ]*$/",$name)) { echo "Only letters and white space allowed\n"; } $email = "Jone"; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Invalid email format"; } ?>
Result:
Report an issue