I have a nested unordered list like this (simplified version / the depth is variable) :
<ul>
<li>
<a href="#">Root</a>
<ul>
<li>
<a href="#">Page A</a>
<ul>
<li>
<a href="#" title="Page A1">Page 1 2</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
Using PHP, is there a nice way to "explode" this nested list in (for this example) 3 lists ?
Thanks for your help
Edit :
The expected output will be :
<ul>
<li>
<a href="#">Root</a>
</li>
</ul>
<ul>
<li>
<a href="#">Page A</a>
</li>
</ul>
<ul>
<li>
<a href="#" title="Page A1">Page 1 2</a>
</li>
</ul>