mirror of
https://github.com/disposable-email-domains/disposable-email-domains.git
synced 2024-12-12 09:54:39 +08:00
Simplified PHP code again
This commit is contained in:
parent
258cd41cbf
commit
b933e1d96f
10
README.md
10
README.md
@ -25,13 +25,9 @@ PHP contributed by @txt3rob
|
||||
```php
|
||||
function is_temp_mail($mail) {
|
||||
$mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach($mail_domains_ko as $ko_mail) {
|
||||
list($mail_address, $mail_domain) = explode('@',$mail);
|
||||
if(strcasecmp($mail_domain, $ko_mail) == 0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
//Need to ensure the mail contains an @ to avoid undefined offset
|
||||
return in_array(explode('@', $mail)[1], $mail_domains_ko);
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user