Re: Foreach question

From: Date: Tue, 05 Jul 2011 14:33:44 +0000
Subject: Re: Foreach question
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-313880@lists.php.net to get a copy of this message
I don't think that it does this: if ( count($elements) == 1 ) then loop 1; else loop normally; It's probably more something like that: $i=count($elements); loop: $i--; if($i == 0) $last_loop = true; else $last_loop = false if($last_loop) exit; else goto loop; But aside from that, I would propose you the same thing Robert already did - Just use while or some other loop (for maybe?).

« previous php.general (#313880) next »