dima_s_d_s
Создатель
- Регистрация
- 5 Дек 2008
- Сообщения
- 22
- Реакции
- 3
- Автор темы
- #1
Есть такой массив
Как можно из этого массива получить такой список:
Заранее благодарен.
Код:
Array
(
[0] => Array
(
[categories_id] => 8
[categories_left] => 3
[categories_right] => 4
[categories_level] => 2
[categories_name] => NameCat_8
[nflag] => 0
)
[1] => Array
(
[categories_id] => 9
[categories_left] => 5
[categories_right] => 6
[categories_level] => 2
[categories_name] => NameCat_9
[nflag] => 0
)
[2] => Array
(
[categories_id] => 3
[categories_left] => 7
[categories_right] => 8
[categories_level] => 2
[categories_name] => NameCat_3
[nflag] => 0
)
[3] => Array
(
[categories_id] => 11
[categories_left] => 9
[categories_right] => 10
[categories_level] => 2
[categories_name] => NameCat_11
[nflag] => 0
)
[4] => Array
(
[categories_id] => 13
[categories_left] => 11
[categories_right] => 12
[categories_level] => 2
[categories_name] => NameCat_13
[nflag] => 0
)
[5] => Array
(
[categories_id] => 14
[categories_left] => 13
[categories_right] => 14
[categories_level] => 2
[categories_name] => NameCat_14
[nflag] => 0
)
[6] => Array
(
[categories_id] => 22
[categories_left] => 15
[categories_right] => 16
[categories_level] => 2
[categories_name] => NameCat_22
[nflag] => 0
[content_title] => <li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
)
[7] => Array
(
[categories_id] => 23
[categories_left] => 17
[categories_right] => 22
[categories_level] => 2
[categories_name] => NameCat_23
[nflag] => 1
[content_title] =>
)
[8] => Array
(
[categories_id] => 24
[categories_left] => 18
[categories_right] => 19
[categories_level] => 3
[categories_name] => NameCat_24
[nflag] => 0
[content_title] => <li><a href="/">ContCat_24</a></li>
<li><a href="/">ContCat_24</a></li>
)
[9] => Array
(
[categories_id] => 25
[categories_left] => 20
[categories_right] => 21
[categories_level] => 3
[categories_name] => NameCat_25
[nflag] => 0
[content_title] =>
)
)
Код:
<ul id="browser7">
<li>NameCat_8</li>
<li>NameCat_9</li>
<li>NameCat_3</li>
<li>NameCat_11</li>
<li>NameCat_13</li>
<li>NameCat_14</li>
<li>
<span class="folder">NameCat_22</span>
<ul>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
<li><a href="/">ContCat_22</a></li>
</ul>
</li>
<li>
<span class="folder">NameCat_23</span>
<ul>
<li>
<span class="folder">NameCat_24</span>
<ul>
<li><a href="/">ContCat_24</a></li>
<li><a href="/">ContCat_24</a></li>
</ul>
</li>
<li>NameCat_25</li>
</ul>
</li>
</ul>