Re: How to list 2-6 in while script?

From: Date: Wed, 12 Sep 2001 12:43:48 +0000
Subject: Re: How to list 2-6 in while script?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-67040@lists.php.net to get a copy of this message
So sprach »Andrew Perevodchik« am 2001-09-12 um 14:45:25 +0300 : > Hello! You wrote: > > >> Hi! I have this script and wonder how to change > >> it to get it list only number 2 to number 6 and > >> not each? > > >> while (list ($key,$val) = each ($headers)) { > >> print > >> "<p><b>"."$val"."</b></p>"; > >> } > > while (list ($key,$val) = each ($headers) and > $key <= 6 and > $key >= 2) { > > print "<p><b>"."$val"."</b></p>"; > } > > Eh? Oh, if $key contains the number, than yes. I understood his question differently. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 7 hours 29 minutes

« previous php.general (#67040) next »