PHP-IP-Location is a project mainly written in PHP, it's free.
A class library that encapsulates a set of IP location classes.
PHP IP Location Library
Use in the following manner.
$objIpLocationObject = new IpLocation_Ip(new IpLocation_Service_GeoIp()); $results = $objIpLocationObject->getIpLocation('66.102.9.105'); // google.com IP address print_r($results); // Print out the results object
The IpLocation_Ip class can take a number of services.
There is also a IpLocation_Url class for converting URL's into locations.