There is no standard PHP function to extract the TLD from a domain name, parsing an URL with parse_url() will return the host name and other URL information. If you need only the TLD, for example to query the WHOIS data of a given domain name, the following script should be useful. To run this script you need a database with all TLD’s. The snippet is using a database table which is required for the scripts functionality, download the MySQL table dump here. Continue reading Extract the TLD from a domain name
Tag: whois
PHP Ajax Whois Script
Recently I’ve changed the PHP Whois demo at finalwebsites.com. I modified the default PHP whois class example script a little bit and used xajax to create a ajax powered request form. Continue reading PHP Ajax Whois Script