Download the PHP package x2nx/domain-parser without Composer
On this page you can find all versions of the php package x2nx/domain-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download x2nx/domain-parser
More information about x2nx/domain-parser
Files in x2nx/domain-parser
Package domain-parser
Short Description Returns complete whois and domain info parser domain information
License MIT
Homepage https://github.com/x2nx/domain-parser
Informations about the package domain-parser
Domain-parser
Returns complete whois and domain info parser domain information
Getting Started
Install using composer:
X2nx Domains parser uses a public suffix PHP dataset auto-generated from the publicsuffix.org. The dataset get periodically updates from us, but you can also manually update it by cloning this library and running the import script with the import command:
If you want to parse ordinary web urls then use
$host = parse_url($return, PHP_URL_HOST); $domain = new \X2nx\DomainParser\Parser($host);
to get the domain object.
Library API
- get() - Return you full domain name.
- getTLD() - Return only the top-level-domain.
- getSuffix() - Return only the public suffix of your domain, for example: co.uk, ac.be, org.il, com, org.
- getRegisterable() - Return the registered or registrable domain, which is the public suffix plus one additional label.
- getName() - Returns only the registerable domain name. For example, blog.example.com will return 'example', and demo.co.uk will return 'demo'.
- getSub() - Returns the full sub domain path for you domain. For example, blog.example.com will return 'blog', and subdomain.demo.cn will return 'subdomain.demo'.
- getWhoisServer() - Returns whois server url info.
- getWhoisInfo() - Returns whois info.
- isKnown() - Returns true if public suffix is know and false otherwise.
- isICANN() - Returns true if the public suffix is found in the ICANN DOMAINS section of the public suffix list.
- isPrivate() - Returns true if the public suffix is found in the PRIVATE DOMAINS section of the public suffix list.
- isTest() - Returns true if the domain TLD is 'locahost' or 'test' and false otherwise.
Support functions
- iana_whois($domain,$is_server) Return the original whois information of the domain name
- iana_domain($domain) Return the components of the domain name, including subdomain, name, top-level domain, original whois information, etc
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php