Get List of Countries in Magento
I have explained the method below for getting the list of Country which we see in Magento. site checkout page.
Below code to be written in Block file in a function (you can even write the code in template file).
<?php
$collection = Mage::getModel('directory/country')->getCollection();
foreach ($collection as $country)
{
$cid = $country->getId();
$cname = $country->getName();
echo 'Country ID -> '.$cid.' Country Name -> '.$cname.'<br/>';
}
?>
Hope this is helpful to many of you.

Thanks! Here’s the code to turn this into a standalone php script
—
getCollection();
foreach ($collection as $country)
{
$cid = $country->getId();
$cname = $country->getName();
echo ‘Country ID -> ‘.$cid.’ Country Name -> ‘.$cname.”;
}
?>
great !