I have data in an array with the following structure:
$persons = array(
array($id, $name, $parent),
array(2, 'John Smith', 0),
array(3, 'Steve Martin', 2),
array(4, 'Peter Griffin', 3),
array(5, 'Cinder Ella', 0)
);
and I would like to get a tree like this:
<ul>
<li>John Smith</li>
<ul>
<li>Steve Martin</li>
<ul>
<li>Peter Griffin</li>
</ul>
</ul>
<li>Cinder Ella</li>
</ul>
Probably this is just as easy as 1-2-3 but I have tried everything already without success...