PHP code example of xrobau / spfcheck

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

    

xrobau / spfcheck example snippets



use Mika56\SPFCheck\SPFCheck;
use Mika56\SPFCheck\DNSRecordGetter;

cord method for lookup.
var_dump($checker->isIPAllowed('127.0.0.1', 'test.com'));

// or

$checker = new SPFCheck(new DNSRecordGetterDirect("8.8.8.8")); // Uses phpdns, allowing you to set the nameserver you wish to use for the dns queries.
var_dump($checker->isIPAllowed('127.0.0.1', 'test.com'));