URI Hostname Parser
This library contains
- a ICANN Section Public Suffix List Manager.
- a Public Suffix Finder class to resolve domain names.
- a helper function to ease resolving domain names with default options.
This library contains a lightweight domain parser using the Public Suffix List (PSL) ICANN section based on the excellent PHP Domain Parser by Jeremy Kendall.
The main differences with PHP Domain Parser are:
- This library only uses the ICANN Section of the Public Suffix List data
- This library supports PHP7.2+
- This library does not validate the hostname nor the cookie header host part
To validate your hostname please refer to URI components
To validate your cookie headers please use PHP Domain Parser.
This library depends on PSR-16.
- PHP >= 7.0 but the latest stable version of PHP is recommended
$ composer require league/uri-hostname-parser