Here is how to get all stores of your Magento instance a an Array:
<?php $aAllStores = Mage::app()->getStores(); foreach ($aAllStores as $iStoreId => $oVal){ $sStoreCode = Mage::app()->getStore($iStoreId)->getCode(); $sStoreName = Mage::app()->getStore($iStoreId)->getName(); $iStoreId = Mage::app()->getStore($iStoreId)->getId(); echo $sStoreCode; echo $sStoreName; echo $iStoreId; } ?>
To include the admin store you can call getStores like that:
$aAllStores = Mage::app()->getStores(true)
A much simpler way to get all stores is:
$aAllStores = Mage::getModel('core/store')->getResourceCollection()->toOptionArray();