元データhogeAry
・子に対する親を parent_id で指定
・親は parent_id = 0
Array
(
[0] => Array
(
[hoge_id] => 2
[hoge] => 親2
[parent_id] => 0
)
[1] => Array
(
[hoge_id] => 3
[hoge] => 子2-1
[parent_id] => 2
)
[2] => Array
(
[hoge_id] => 4
[hoge] => 子7-1
[parent_id] => 7
)
[3] => Array
(
[hoge_id] => 7
[hoge] => 親7
[parent_id] => 0
)
[4] => Array
(
[hoge_id] => 1
[hoge] => 親1
[parent_id] => 0
)
)
希望出力結果
<ul>
<li>親1</li>
<li>親2
<ul>
<li>子2-1</li>
</ul>
</li>
<li>親7
<ul>
<li>子7-1</li>
</ul>
</li>
</ul>