mam taki kod
while ($item = $dbtree->NextRow()) { if (@$_GET['section_id'] <> $item['section_id']) { if( $item['section_hiden'] == 0) echo "".str_repeat('-', 1 * $item['section_level']) . '<a href="'.$item['section_href'].'?section_id=' . $item['section_id'] . '">' . $item['section_name'] . '</a><br/>'; } else { if( $item['section_hiden'] == 0) echo "".str_repeat('-', 1 * $item['section_level']) . '<strong>' . $item['section_name'] . '</strong><br/>'; } }
Generuje mi drzewo kategorii do takie postaci:
Kod
-Node 2
--Subnode 1
---Sub subnode 1
--Subnode 2
--Subnode 3
-Node 3
-Node 4
--Subnode 1
---Sub subnode 1
--Subnode 2
--Subnode 3
-Node 3
-Node 4
W jaki sposób ugryźć generowanie list <ul> z zachowaniem hierarchi. Myślałem o funkcji count oraz o levele.