PHP Classes

Nice simple class.

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in

      City to Province - Netherlands  >  All threads  >  Nice simple class.  >  (Un) Subscribe thread alerts  
Subject:Nice simple class.
Summary:Package rating comment
Date:2008-10-07 12:07:37
Update:2008-10-07 14:08:00

Vince rated this package as follows:

Utility: Sufficient
Consistency: Sufficient
Examples: Sufficient

  1. Nice simple class.   Reply   Report abuse  
Picture of Vince Vince - 2008-10-07 12:07:38
Nice simple class. Does what it has to do. I've 2 remarks;

1. The city names are hard-coded into the class. I think there are better way's to implement that. (discuss ?)

2. The provinces have a code. I believe it's better to use coding according to ISO 3166-2:NL. With some small effort there is conformation to a international standardization. It can be discussed if it's the best standard ;-)

  2. Re: Nice simple class.   Reply   Report abuse  
Picture of Ashraf Gheith Ashraf Gheith - 2008-10-07 12:35:16 - In reply to message 1 from Vince
I am open to any new idea's, it was just a class I made and used in one project. What do you think, how can I make the cities list? Also do you have a link for province codes by ISO? I am not dutch, I do not know geography of the Netherlands :)

  3. Re: Nice simple class.   Reply   Report abuse  
Picture of Vince Vince - 2008-10-07 14:08:00 - In reply to message 2 from Ashraf Gheith
The main problem with hard coded information is: maintenance. If something in the data changes, the programmer has to update the program.

Better to get the information from external source. Mostly used are databases. This way you are making updating the information program independent.

Remains the problem of having the correct information. In this case the ISO is the organisation to look at. ( The maintain the list ISO 3166. ISO 3166-2 is a subset of this list and gives you information about divisions in a country.

The best way (IMHO) is to retrieve information from the source. This way your class can concentrate on updating/retrieval and presenting the information. This will make live a bit more easy to programmers/sysops and users.

An example list of the ISO 3166-2:NL can be found on: