This package is abandoned. Please consider using an stable alternative for any production code.

URI Hostname Parser

Build Status Latest Version

This library replaces PHP Domain Parser starting with version 5.2.0

This library contains

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.

System Requirements

You require:

  • PHP >= 7.0 but the latest stable version of PHP is recommended
  • the intl extension

Installation

$ composer require league/uri-hostname-parser