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,}$/", $email)) { echo "Valid email address"; } else { echo "Invalid email address"; } ?>
Result:
Report an issue