Very basic question, but I've forgotton how to do this:
Code: Select all
foreach ($my_array as $temp_key => $temp_value)
{
if($condition)
//stop this loop and go to next
else
//continue with script
}Moderator: General Moderators
Code: Select all
foreach ($my_array as $temp_key => $temp_value)
{
if($condition)
//stop this loop and go to next
else
//continue with script
}Code: Select all
foreach() {
if ($con) continue;
// rest of loop, no else is really needed as continue moves to the next item immediately.
}