For Understand first try this
<?php echo "<pre/>"; $categories = Mage::getResourceModel('catalog/category_collection') ->addAttributeToSort('name','ASC') ->getData('name'); for ($i=0; $i < count($categories); $i++) { echo $categories[$i]['name']."<br/>"; } die(); ?> For Output :-
<?php $_categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('name') ->addAttributeToSelect('is_active') ->addAttributeToSort('name','ASC') ->addUrlRewriteToResult(); foreach($_categories as $_category) { echo "<a href=".$_category->getUrl($_category).">".$_category->getName($_category)."</a><br/>"; //echo "<pre/>"; //echo $_category->getUrl($_category); } die; ?>