title: In Magento how do I get the listing of categories in the order you see in the admin area?
body: <p>I can get a list of the children categories for a specific category with the following code:</p>
  
  <pre><code>public function displaycats($data, $begin,$end, $catid){
      $currentCat = Mage::getModel('catalog/category')-&gt;load($data[0]);
      $children = explode(",",$currentCat-&gt;getChildren());
  
      foreach ($children as $child) {
      $cot++;
      $subCat = Mage::getModel('catalog/category')-&gt;load($child);
  
          if ($cot &gt;= $begin &amp;&amp; $cot &lt;= $end){
              echo '&lt;a href="'.$subCat-&gt;getUrl().'?stockable=786"&gt;'.$subCat-&gt;getName()."&lt;/a&gt;&lt;br&gt;";
          }
      }
      return;
  }
  </code></pre>
  
  <p>The problem is that the list is not ordered the same as Magento has the categories ordered in the admin area. Can anyone help me out?</p>