Foreach - continue loop some levels up

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
weebee
Forum Newbie
Posts: 2
Joined: Fri Jan 30, 2009 7:25 pm

Foreach - continue loop some levels up

Post by weebee »

How to contiune the foreach loop when I am in the middle of a "if" in a "if" in a "foreach"?

Code: Select all

 
foreach($array_content_each_line as $each_line){
 
    if(// SOMETHING //){
        if(//SOMETHING){
--->    // IF THIS IS TRUE, I WANT TO CONTINUE ON THE NEXT FIELD IN THE $array_content_each_line
        }
        else {
        }
    }
 
    if(// OTHER STUFF){
        // NOTHING SPECIAL HERE
    }
    else {
        if( // STUFF){
        }
        if ( // STUFF){         
        }
        // MORE CODE HERE
    }
}
 
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Foreach - continue loop some levels up

Post by Benjamin »

Code: Select all

 
continue;
 
weebee
Forum Newbie
Posts: 2
Joined: Fri Jan 30, 2009 7:25 pm

Re: Foreach - continue loop some levels up

Post by weebee »

Great! Thank you! :D
Post Reply