|
Posted by Ed on 10/14/05 19:09
Oliver Saunders wrote:
> This is an amazing opportunity to win a tin of sardines if you can
> answer this difficult question correctly!
>
> Question:
> What kind of loop do you need to turn an array like this:
>
> $notes = array(
> '1:1',
> '1:2',
> '1:3'
> array(
> '2:1',
> '2:2',
> array(
> '3:1',
> '3:2'
> );
> '2:3'
> );
> '1:4'
> array(
> '2:4',
> '2:5'
> )
> );
>
> into a list like this:
>
> <ul>
> <li>1:1</li>
> <li>1:2</li>
> <li>1:3</li>
> <ul>
> <li>2:1</li>
> <li>2:2</li>
> <ul>
> <li>3:1</li>
> <li>3:2</li>
> </ul>
> <li>2:3</li>
> </ul>
> <li>1:4</li>
> <ul>
> <li>2:4</li>
> <li>2:5</li>
> </ul>
> </ul>
FYI - The way you have nested the lists is invalid. A nested list can
only be inside another list element :)
Ed
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
[Back to original message]
|