views:

238

answers:

4

I am currently working on a PHP application that puts me in the desperate need of all the Countries, States and Cities in the world.

In the application, when you select a Country from the drop down menu, it loads up all the States in the selected Country into another drop down menu. When you then select a State from the newly generated drop down menu, it then loads up all the cities in the selected State into another drop down menu.

The challenge now is getting all the Countries, States and Cities. I have tried searching Google without results.

Am wondering if there is any PHP library or application that has all Countries, States and cities in it, so i can download and extend.

Thanks very much for your time.

+2  A: 

A good place to start would be MaxMind PHP library which uses the freely available MaxMind.com database

Richard Harrison
tried downloading the list of all cities in the world but it keeps disconnecting before the download finishes and worst of all, it does not support resume capabilities. Any advise on what i can do?
IndexController
I just download it fine. Keep trying. If you still have problems contact me directly.
Richard Harrison
+2  A: 

there is GeoDataSource World Cities Database (Gold Edition) March.2010. This contains:

  • city database
  • latitude longitude
  • city latitude
  • cities database
  • world cities
  • global cities
  • world countries
  • distance calculator
  • state list
  • gazetteer
  • place names
  • populated places
  • GPS

and more, there is even a basic and premium package.

** EDIT

May not be worthwhile if your looking for something free however because the free package only offers city names. The basic package is One Month - $149.95 One Year - $449.95

and the packages only get more expensive.

Justin Gregoire
A: 

Also, this should be a data library, not a code library. You might try the USPS to see if they have a city/state/zip DB downloadable for free.

Zak
A: 

Thanks for Justin that I have trying out the GeoDataSource package for displaying country, state, and city data accordingly without any problem. I also able to show the timezone correctly.

hexahow