Source Code:
(back to article)
<?php $email = "user@example.com"; if (!preg_match("/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/", $email)) { echo "Invalid email format"; } else { echo "Valid email format"; } ?>
Result:
Report an issue