PHPackages                             xrobau/spfcheck - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xrobau/spfcheck

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xrobau/spfcheck
===============

Checks an IP address against a domain's SPF record

1.2.0(4y ago)013MITPHPPHP &gt;=5.4

Since Jan 5Pushed 4y agoCompare

[ Source](https://github.com/xrobau/PHP-SPF-Check)[ Packagist](https://packagist.org/packages/xrobau/spfcheck)[ RSS](/packages/xrobau-spfcheck/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (11)Used By (0)

PHP-SPF-Check
=============

[](#php-spf-check)

[![Build Status](https://camo.githubusercontent.com/63455438d03c36af1ee88c188efe47e14875ebf68333caa69fd9df255ea11ba2/68747470733a2f2f7472617669732d63692e6f72672f4d696b6135362f5048502d5350462d436865636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Mika56/PHP-SPF-Check)[![Latest Stable Version](https://camo.githubusercontent.com/d2c6dda2e9291d5071de6b53157fc40580b77d142a725bd0bb32b7e32416a7d8/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f762f737461626c65)](https://packagist.org/packages/mika56/spfcheck)[![Total Downloads](https://camo.githubusercontent.com/0dd0c6ff1c7a734901aeccccbc53b46f03e0cda4321eaa6bb29e8ec71cdde7d4/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f646f776e6c6f616473)](https://packagist.org/packages/mika56/spfcheck)[![License](https://camo.githubusercontent.com/6fd5ca8df09f8fa600edc708d3d468aae6223b3c1cceaa9fe1df1377179f83f1/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f6c6963656e7365)](https://packagist.org/packages/mika56/spfcheck)[![Coverage Status](https://camo.githubusercontent.com/7067229a4ad29f0a8da910b67e1adbe279698bfca2aa25a7f5a2b1e52049be01/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d696b6135362f5048502d5350462d436865636b2f62616467652e737667)](https://coveralls.io/github/Mika56/PHP-SPF-Check)

Simple library to check an IP address against a domain's [SPF](http://www.openspf.org/) record

This is an updated fork of `mika56/spfcheck`, with only minor changes.

Installation
------------

[](#installation)

This library is available through Composer. Run `composer require xrobau/spfcheck` or add this to your composer.json:

```
{
  "require": {
    "xrobau/spfcheck": "^1"
  }
}
```

Usage
-----

[](#usage)

Create a new instance of SPFCheck. The constructor requires a DNSRecordGetterInterface to be passed. Currently, you have two options:

- `DNSRecordGetter` which uses PHP's DNS functions to get data
- `DNSRecordGetterDirect` which uses the [PHP DNS Direct Query Module](https://github.com/purplepixie/phpdns) to get data.

```
