Re: How to create html list from such array ?



lp пишет:
I've got an example array like this:

$myArr = array(
    array("jj", "0", "jjj"),
    array("ee", "0", "eee"),
    array("bb", "ee", "bbb"),
    array("ll", "ee", "lll"),
    array("ff", "0", "fff"),
)

Where each row is an array with columns: id of list element, id of parent
list element ("0" means main node) and content of the element. So, from my
array I'd like to create a list like this:

<ul>
    <li>jjj</li>
    <li>eee
        <ul>
            <li>bbb</li>
            <li>eee</li>
        </ul>
    </li>
    <li>fff</li>
<ul>

Could anybody help me ?

Best regards.
LP



Look's like a usual tree. Try to use not array, but SQL DB, it's easy .