Subesh Pokhrel

Magento Developers Blog

MagNotes Series : Magento Get Locale Options as Single Array

About MagNotes Series In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided to create a series (MagNotes Series) , for myself as a reference or for whoever think this is helpful.
[source lang=”php”] // Get all the locale options $locale = new Mage_Adminhtml_Model_System_Config_Source_Locale(); $localSource = $locale->toOptionArray(); // Change Options array to one dimentional array $localSourceCodes = array(); foreach ($localSource as $source) { $localSourceCodes [$source [‘value’]] = $source [‘label’]; } [/source]