php-extended / php-tld-object
An implementation of the php-tld-interface library
9.0.7
2026-05-20 00:35 UTC
Requires
- php: >=8.2
- php-extended/php-tld-interface: ^9
Requires (Dev)
This package is auto-updated.
Last update: 2026-05-19 22:35:35 UTC
README
An implementation of the php-tld-interface library.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-tld-object ^9
Basic Usage
You may use this library this way to build a hierarchy :
use PhpExtended\Tld\TopLevelDomainHierarchy;
use PhpExtended\Tld\TopLevelDomainNode;
$hierarchy = new TopLevelDomainHierarchy();
$hierarchy->addNode(new TopLevelDomainNode('edu'));
$com = new TopLevelDomainNode('com');
$com->addNode(new TopLevelDomainNode('example');
$hierarchy->addNode($com);
$hierarchy->isTld('example.com'); // true
$hierarchy->isTld('example.edu'); // false
License
MIT (See license file).