I do not know if Zend has something for this, but it is quite easy to do it yourself.
This guide shows how you can get the latest list of ISO 3166-1 country codes in XML format, parse it and then create a PHP file that can be included when you need an array of country code conversions:
$str = file_get_contents('http://opencountrycodes.appspot.com/xml/'); $xml = new SimpleXMLElement($str); $out = '$countries'." = array(\n"; foreach ($xml->country as $country) { $out .= "'{$country['code']}' => \"{$country['name']}\",\n"; } $out .= ");"; file_put_contents('country_names.php', $out);
Alternatively, you can save it as a CSV file and load it using the PHP fgetcsv() function . This will probably be preferable to IMO. Or, to hell, you can just save the XML and parse it when you load it.
source share