IPGeolocation is a PHP class which provides an easy-to-use interface to the IP Address Location XML API described at ipinfodb.com. This API allows you to find the city, state/region, and country associated with an IP address, as well as the address's approximate latitude and longitude.
Usage
require_once('IPGeolocation.class.php');
$location = new IPGeolocation($ipAddressString);
// do some error checking here
$strCityStateCountry = $location->getFriendlyLocation();
The class aims to be easy-to-use, versatile, and well-documented. It is released under the GPLv3 license.