Re: A bug in section loop

From: Date: Tue, 17 Jul 2001 07:45:32 +0000
Subject: Re: A bug in section loop
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1173@lists.php.net to get a copy of this message
Hi, Andrei Zmievski wrote:
The arrays you are looping through with {section} are supposed to be contiguous.
Would it not be nice if you could support non contiguous arrays as well? It's quite easy. You just have to change your loop a bit. Instead of a 'normal' loop, like for($i=0;$i<count($array);$i++) { echo $array[$i]; } you could do: foreach($array as $key => $value) { echo $value; } This way you could even loop associative arrays.. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

« previous php.smarty.general (#1173) next »