Created
September 20, 2012 10:08
-
-
Save kasperhartwich/3755050 to your computer and use it in GitHub Desktop.
Array stristr version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $illegal_domain_names = array( | |
| 'gmail.con', | |
| 'gamil.com', | |
| 'gail.com', | |
| 'gmil.com', | |
| 'gmail.co', | |
| 'hotnail.com', | |
| 'hormail.com', | |
| 'hotmail.con', | |
| 'hotmil.com', | |
| 'hotmial.com', | |
| 'hotmial.com', | |
| 'hotmail.cm', | |
| ); | |
| if(preg_match('/' . implode('|', array_map('preg_quote', $illegal_domain_names)) . '/i', $email)) { | |
| //Illegal domainname | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment