php-idn-email-validation
By: pne | Date: Oct 18 2018 20:22 | Format: PHP | Expires: never | Size: 1.35 KB | Hits: 852
- // Valid
- $email_a = 'test@xn--38j2b6b6e.xn--q9jyb4c';
- $email_b = 'testä@にほんご.みんな';
- $email_c = 'jo@faß.de';
- $email_d = 'asd@√.com';
- // Invalid
- $email_z = 'asd@Ⱥbby.com';
- $email_y = 'a@‡.com';
- $email_x = 'asd@ԛәлп.com';
- ->validate($email_?,false);
- var $regex = '/^([a-zA-Z0-9&_?\/`!|#*$^%=~{}+\'-]+|"([\x00-\x0C\x0E-\x21\x23-\x5B\x5D-\x7F]|\\[\x00-\x7F])*")(\.([a-zA-Z0-9&_?\/`!|#*$^%=~{}+\'-]+|"([\x00-\x0C\x0E-\x21\x23-\x5B\x5D-\x7F]|\\[\x00-\x7F])*"))*@([a-zA-Z0-9&_?\/`!|#*$^%=~{}+\'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[\x00-\x7F])*\])(\.([a-zA-Z0-9&_?\/`!|#*$^%=~{}+\'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[\x00-\x7F])*\]))*$/';
- function validate($email, $checkDomain = false)
- {
- foreach ($parts as &$part) {
- $part = idn_to_ascii($part);
- }
- }
- }
- }
- return true;
- }
- return false;
- }
- return true;
- }
- return false;
- }
Latest pastes
16 hours ago
17 hours ago
1 days ago
2 days ago
4 days ago