Created
July 12, 2016 08:31
-
-
Save msenkpiel/61fbef86cf6daae54e9d02b5ef784e35 to your computer and use it in GitHub Desktop.
Zend Locale: Create a country dropdown list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$countries = Zend_Locale::getTranslationList('territory'); | |
asort($countries); | |
$options = array(); | |
foreach ($countries as $short => $translation) { | |
if (strlen($short) == 2) { | |
$options[] = [ | |
'key' => $translation, | |
'value' => $short | |
]; | |
} | |
} | |
return $options; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment