<?php
$terms = get_terms('teslimat', 'orderby=count&hide_empty=0');
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
if (0 == $term->parent) $parentsItems[] = $term;
if ($term->parent) $childItems[] = $term;
}
$i=0;
foreach ($parentsItems as $parentsItem){
$ilce[$i] = $parentsItem;
//$semt[$i][0] = $parentsItem;
$j=0;
foreach ($childItems as $childItem) {

if ($childItem->parent == $parentsItem->term_id){
$semt[$i][$j] = $childItem;
$j++;
};
};
$i++;
};
}
?>