php-extended/php-suffix-list-bundle

A library to safely validate top level domains

1.1.26 2018-12-09 01:00 UTC

README

A library to safely validate top level domains.

This library uses the https://publicsuffix.org/list/public_suffix_list.dat source file to update its contents. This library is updated once a week, every sunday.

Last Updated Date : 2018-12-09

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-suffix-list-bundle": "^1",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

You may use this library the following way:


use PhpExtended\SuffixList\PublicSuffixListBundle;

$domain = '<put the domain you want to check there>';

$isTLD = PublicSuffixListBundle::isInTheList($domain);
// true if the domain is in the list, false otherwise

License

MIT (See license file).