Geo2City is a PHP function that takes in one-or-more geo-location (in decimal latitude and longitude format) and returns the nearest city(s) in either an array, JSON or XML.
Geo2City evolved from needing some starting points for understanding latitude/longitude analysis and translating to nearest city/state. It is based to work in the US, but that's only because it pulls from zipcodes.csv (which is pulled from the public-domain works available at http://sourceforge.net/projects/zips/). Is used caching, either memcache or APC, because loading & analyzing the CSV file each time is too expensive. In a typical production environment, the data should be stored in a database (like MySQL) and the caching-layer just introduces a new level of performance.
The first load will be slow, as its priming the cache. All subsequent loads will be very fast.
Bugs & Rationale
It has not been widely tested, is probably not suitable for production-use, and is mostly oriented towards small, started projects and people getting started in geo-coordination work. Yahoo's PlaceFinder API is a much better starting point: http://developer.yahoo.com/geo/placefinder/