Download the PHP package rincler/domain without Composer
On this page you can find all versions of the php package rincler/domain. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download rincler/domain
More information about rincler/domain
Files in rincler/domain
Download rincler/domain
More information about rincler/domain
Files in rincler/domain
Vendor rincler
Package domain
Short Description A domain name value object. Works with IDN and punycode syntax, validates and easily retrieves the level, zone and TLD (top-level domain).
License MIT
Package domain
Short Description A domain name value object. Works with IDN and punycode syntax, validates and easily retrieves the level, zone and TLD (top-level domain).
License MIT
Please rate this library. Is it a good library?
Informations about the package domain
Domain
A domain name value object. Works with IDN and punycode syntax, validates and easily retrieves the level, zone and TLD (top-level domain).
Usage
Installation
Documentation
- static
isValid(): bool
- Returnstrue
if the domain is valid, returnsfalse
otherwise __constructor(string $domain)
- The constructor validates the domain (throwsInvalidDomainException
if the domain is not valid) and creates the value objectasIdn(): string
- Returns the domain in IDN syntaxasPunycode(): string
- Returns the domain in Punycode syntaxequals(Domain $domain): bool
- Returnstrue
if the current domain equals the specified domain, returnsfalse
otherwisegetLevel(): int
- Returns the number of domain levelsgetZone(): Domain
- Returns the domain zonegetWithoutZone(): Domain
- Returns the domain without a zonegetTld(?TldRetrievalMode $mode = null): Domain
- Returns the top-level domaingetWithoutTld(?TldRetrievalMode $mode = null): Domain
- Returns the domain without a top-level domaingetLabels(): array
- Returns an array of the domain labelsgetLabel(int $level): array
- Returns the label of the domain with number $levelsliceToLevel(int $level): array
- Returns the domain to level with number $level__toString(): string
- An equivalent for theasIdn
method
Custom TLDs
You can use custom TLDs, e.g.: net.ru
or org.ru
, using the setCustomTlds
method:
You can specify the TLD retriever mode:
TldRetrievalMode::TRUE()
- the mode to retrieving only true TLDTldRetrievalMode::CUSTOM()
- the mode to retrieving only custom TLDTldRetrievalMode::MIX()
- the mode to retrieving custom TLD and true TLD if custom is not found (this mode is used by default)
Also, you can specify the TLD retriever mode globally:
Why PHP >= 7.3?
Validation of domain in intl extension fixed in 7.3.0. See http://bugs.php.net/76829
License
This library is released under the MIT license.
All versions of domain with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.3.0
ext-intl Version *
ext-mbstring Version *
myclabs/php-enum Version ^1.8
ext-intl Version *
ext-mbstring Version *
myclabs/php-enum Version ^1.8
The package rincler/domain contains the following files
Loading the files please wait ....