Skip to content

Instantly share code, notes, and snippets.

@msenkpiel
Created July 12, 2016 08:31
Show Gist options
  • Save msenkpiel/61fbef86cf6daae54e9d02b5ef784e35 to your computer and use it in GitHub Desktop.
Save msenkpiel/61fbef86cf6daae54e9d02b5ef784e35 to your computer and use it in GitHub Desktop.
Zend Locale: Create a country dropdown list
$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