php-extended/php-suffix-list-bundle

This package is abandoned and no longer maintained. The author suggests using the php-extended/php-tld-provider-mozilla package instead.

A library to safely validate top level domains


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 : 2020-09-13

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": "^2",
		...
	}

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).