Login   Register  
PHP Classes

PHP TLD Domain Name: Determine the Top Level Domain from a given URL

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2013-04-25 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 292 This week: 3All time: 6,643 This week: 673Up
Version Licenses PHP version Categories  
tld 0.1GNU General Public Lice...5.3Networking, PHP 5
Description Author  

This class can determine the Top Level Domain from a given URL.

It can parse a given URL to extract the respective domain name.

The class can lookup a domain definition file retrieve from the Mozilla site to determine the actual part of the URL domain that is the top level domain.

It can also retrieve an updated version of the the top level domain definition file from the Mozilla file, so the TLD definition is determined more accurately.

Innovation Award  
PHP Programming Innovation award nominee
May 2013
Number 7
The top level domain is the part of a domain name that defines the end of a domain.

In some cases it is easy to determine the top level domain because it is the name after the last point in the domain name. In many other cases it is no so easy because it is not after the last point and there is no rule to determine it.

This class can determine what is the top level domain of most known domain names using a Mozilla domain file.

Manuel Lemos
Picture of Artur Barseghyan
Name: Artur Barseghyan <contact>
Classes: 4 packages by
Country: The Netherlands The Netherlands
Age: 35
All time rank: 194559 in The Netherlands The Netherlands
Week rank: 517 Up19 in The Netherlands The Netherlands Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Files folder imageres (1 file)
Plain text file exceptions.php Class Exceptions
Accessible without login Plain text file readme.txt Doc. Readme
Accessible without login Plain text file tests.php Example Test/example
Accessible without login Plain text file update.php Appl. Update script to be used from command line
Plain text file utils.php Class Main file

  Files folder image Files  /  res  
File Role Description
  Accessible without login Plain text file effective_tld_names.dat.txt Data Test/example

 Version Control Unique User Downloads Download Rankings  
 0%Total:292All time:6,643
 This week:3This week:673Up