mirror of
https://github.com/disposable-email-domains/disposable-email-domains.git
synced 2024-08-26 00:00:48 +02:00
commit
8fe5a7c279
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