li tree menu from array
<p>I have array:</p>

<p>parent 1 is first step!</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [categoryID] =&gt; 1
            [parent] =&gt; 1
            [name] =&gt; 111
        )

    [1] =&gt; Array
        (
            [categoryID] =&gt; 2
            [parent] =&gt; 1
            [name] =&gt; 2222
        )

    [2] =&gt; Array
        (
            [categoryID] =&gt; 3
            [parent] =&gt; 2
            [name] =&gt; 3333
        )
    [3] =&gt; Array
        (
            [categoryID] =&gt; 4
            [parent] =&gt; 3
            [name] =&gt; 444
        )

)
</code></pre>

<p>In result I need tree structure with ul and li elements:</p>

<pre><code>&lt;ul&gt;
 &lt;li&gt;111&lt;/li&gt;
 &lt;li&gt;222
  &lt;ul&gt;
   &lt;li&gt;333
   &lt;ul&gt;
    &lt;li&gt;444&lt;/li&gt;
   &lt;/ul&gt;
   &lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Thanks!</p>
