Jump to content

break just this iteration but continue the loop...


freelance84

Recommended Posts

 

This seems like such an obvious thing, but i cant seem to find the answer...

 

foreach($directoryArray as $directory)
{
	if($dir == 'horse' && $directory == 'farm')
		{
			//stop just this iteration
		}
//carry on doing stuff
}

 

I know i could just simply put nothing in that if and follow it with an else it would do the job... however, sometimes i find i want to add something like this to a script i already wrote, which may sometimes be very complex and it would be handy to add a simple 'stop just this iteration' without out an if and else... Does this exist?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.