Last active
December 18, 2015 13:09
-
-
Save githiro/5787413 to your computer and use it in GitHub Desktop.
PHP: isVaildInetAddress - PEAR Class Mail_RFC822(not strict mode only)
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
| function isValidInetAddress($data) | |
| { | |
| $regex = '/^([*+!.&#$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i'; | |
| if (preg_match($regex, trim($data), $matches)) | |
| { | |
| return array($matches[1], $matches[2]); | |
| } | |
| else | |
| { | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment