Page 1 of 1

Itirating foreach loop inside ?

Posted: Thu Jul 10, 2003 10:53 am
by fd ski
Rather simple code...

foreach ($a as $e){

if(...){
do something, and don't process the rest of this foreach segment, just iterate to next one
}

if(...){
do something, and don't process the rest of this foreach segment, just iterate to next one
}


}

I tried break but it gets out of the whole statement ( foreach )
Example is simplified, there are multiple ifs indiside of foreach and it would really simplify things if i could "break" out of current iteration and have next one start right away, for clarity as well as processing time reasons.

Any ideas ? Thank you very much.

Posted: Thu Jul 10, 2003 10:59 am
by ik
Hi,
Just as in C,

Code: Select all

continue
does exactly what you want