04-08-2012, 09:40 PM
For my website I need to enter a list of countries, counties, towns / cities in a database. I have started entering them manually myself but this is incredibly time consuming. I assume I could buy this from somewhere, I have tried looking on google, I'm not sure if I am entering the wrong search terms or I just don't know where to look. But if anyone can point me in the right direction I would appreciate it.
Here's a free list in a PHP array:
Haven't checked to see if all the countries are there, but it looks like they're all there!
04-09-2012, 08:34 PM
Thanks for the reply Erve, unfortunately I have the list of countries, it is the counties / regions, towns / villages which is the really time consuming part and that I am sure must be available to buy somewhere.
Ah, sorry. Missed that bit!
04-10-2012, 09:12 AM
Why do you need this database? Requiring every town and city in the entire world seems to be an infeasible condition, considering the world is constantly growing. How would you use this?
04-10-2012, 01:35 PM
It is for a travel site. It doesn't need to be every village and town, but countries do need to be broken down in regions and then key tourist places to visit.
04-10-2012, 08:12 PM
I am guessing that if it is available for purchase it is probably out of price range since I presume google has spent (most likely) over a few million to map the entire world.
The open source e-Commerce system Opencart (http://www.opencart.com/) comes with a list of countries and zones already set up - you could probably extract what you need from that. Zones equate to UK counties, US states etc - about 4k of these in total. It doesn't go below zones to cities however.