While browsing php.net without any scope I discovered a very cute & nice way to replace the usual regular expression email checking thing. That way is via filter_var() php function which does the things 10 times faster :
1 2 3 4 5 6 7 8 9 |
<?php $email = "someone@example.com"; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Invalid email address"; } ?> |