You are here: Re: PHP Array Challenge! « PHP Programming Language « IT news, forums, messages
Re: PHP Array Challenge!

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 =----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация