Ir al contenido principal

Entradas

Mostrando entradas de abril, 2014

ISO 3166-2 region list for PHP

Thanks to Jerome Mouneyrac for pointing out that the iso-codes package in Debian is a good source for this data, as well as the script to turn it from XML to PHP.
This particular list comes from the 3.52 release of the package, which can be found online here. To make your own list out of a newer release get the XML file by clicking on iso-codes-[tag] on that page, then tree > iso_3166_2/iso_3166_2.xml ; and then use this script (fixed/improved from Jerome's).

<php
/*
Copyright Notice

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of th…