I get results from a MYSQL query, and I'm struggling turning this array into a nested list :
Array(
[0] => Array
(
[post_title] => Esprit
[post_id] => 240
[folder_id] => 236
)
[1] => Array
(
[post_title] => GC
[post_id] => 241
[folder_id] => 236
)
[2] => Array
(
[post_title] => Guess
[post_id] => 242
[folder_id] => 236
[children] => Array
(
[0] => Array
(
[post_title] => Jewels
[post_id] => 250
[folder_id] => 242
[children] => Array
(
[0] => Array
(
[post_title] => Products-shots
[post_id] => 251
[folder_id] => 250
[children] => Array
(
[0] => Array
(
[post_title] => New-Collection
[post_id] => 252
[folder_id] => 251
)
)
)
)
)
)
)
[3] => Array
(
[post_title] => Guess-Connect
[post_id] => 243
[folder_id] => 236
)
[4] => Array
(
[post_title] => Nautica
[post_id] => 244
[folder_id] => 236
)
[5] => Array
(
[post_title] => Obaku
[post_id] => 245
[folder_id] => 236
)
[6] => Array
(
[post_title] => Police
[post_id] => 246
[folder_id] => 236
)
[7] => Array
(
[post_title] => Roamer
[post_id] => 247
[folder_id] => 236
)
[8] => Array
(
[post_title] => Superdry
[post_id] => 248
[folder_id] => 236
)
[9] => Array
(
[post_title] => Vulcain
[post_id] => 249
[folder_id] => 236
)
)
I tried tons of codes, but none can get me this precise output :
<ul>
<li>Esprit</li>
<li>GC</li>
<li>Guess
<ul>
<li>Jewels</li>
<li>Products-shot</li>
<li>New-collection</li>
</ul>
</li>
<li>Guess-Connect</li>
<li>Nautica</li>
<li>Obaku</li>
<li>Police</li>
<li>Roamer</li>
<li>Superdry</li>
<li>Vulcain</li>
</ul>
I'd really appreciate help ! Thanks in advance