chir.ag/tech [archive]

 
 
 
 
 
 
 

/tech home / projects / personal 'blog / about chir.ag

 

ARCHIVE: PHP GeoIPLocation Library: Freeware

Sat. Dec 3rd 2005, 11:22pm:

I have just released a new free PHP Library that makes GeoIP Location child's play. The PHP GeoIPLocation Library is a single PHP file that will let you determine the country of location for any given IP address.

GeoIPLoc does not require any large database tables, flat text files, or any special configuration on your server. Using GeoIPLoc is as easy as calling the getCountryFromIP() function with any IP address of the form 'x.x.x.x' where 'x' is any integer between 0 and 255.

The library is automatically updated once a day by downloading the free IP address database from Software77.net. The auto-generation utility then sorts and compacts the data in the most efficient way to reduce the size of the resulting PHP file.

Additionally, the library uses a rudimentary caching algorithm that drastically speeds up batch querying of IP addresses, e.g. while parsing browser access logs.

Demo: To view a demo and start using it yourself, check out the PHP GeoIPLocation Library page.