PHP code example of mhoffmann / phpdnsrbl

1. Go to this page and download the library: Download mhoffmann/phpdnsrbl 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/ */

    

mhoffmann / phpdnsrbl example snippets


$rbl = new DNSRBL(
    array(
        'dnsbl' => array(
            'sbl.spamhaus.org'
        ),
        'surbl' => array(
            'dbl.spamhaus.org'
        )
    )
);

//checks the surbl
var_export($rbl->isListed('dbltest.com')); echo ";\n";

//checks the dnsbl
var_export($rbl->getListingBlacklists('127.0.0.2')); echo ";\n";

true;
array (
  0 => 'sbl.spamhaus.org',
);