PHP code example of ely / php-tempmailbuster

1. Go to this page and download the library: Download ely/php-tempmailbuster library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ely / php-tempmailbuster example snippets


use Ely\TempMailBuster\Loader\AntiTempmailRepo;
use Ely\TempMailBuster\Storage;
use Ely\TempMailBuster\Validator;

$loader = new AntiTempmailRepo();
// A storage can be instantiated by feeding it with an array of patterns:
$storage = new Storage($loader->load());
// or created from loader instance
$storage = Storage::fromLoader($loader);

$validator = new Validator($storage);
$validator->validate('[email protected]'); // = true
$validator->validate('[email protected]'); // = false

// Enable whitelisting mode
$validator->whitelistMode();
$validator->validate('[email protected]'); // = false
$validator->validate('[email protected]'); // = true