| Line | |
|---|
| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | function gfIsMobileMailAddress($address) {
|
|---|
| 4 | $arrMobileMailDomains = array('docomo.ne.jp', 'ezweb.ne.jp', 'softbank.ne.jp', 'vodafone.ne.jp', 'pdx.ne.jp');
|
|---|
| 5 |
|
|---|
| 6 | if (defined('MOBILE_ADDITIONAL_MAIL_DOMAINS')) {
|
|---|
| 7 | $arrMobileMailDomains = array_merge($arrMobileMailDomains, split('[ ,]+', MOBILE_ADDITIONAL_MAIL_DOMAINS));
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | foreach ($arrMobileMailDomains as $domain) {
|
|---|
| 11 | $domain = str_replace('.', '\\.', $domain);
|
|---|
| 12 | if (preg_match("/@([^@]+\\.)?$domain\$/", $address)) {
|
|---|
| 13 | return true;
|
|---|
| 14 | }
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | return false;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | print(gfIsMobileMailAddress('[email protected]'));
|
|---|
| 22 |
|
|---|
| 23 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.