I am wanting to get a loop to loop without going through all the code for the loop. For instance in the example code I want to continue the loop without have to go through any of the if statements below the one that matches.
NOTE: I know something similar to this example would be better done using a switch statement but my set of if statements are not as simple as this.
foreach($array as $key=>$value){
if(is_varchar($value)){loop;}
if(is_text($value)){loop;}
if(is_mediumText($value)){loop;}
if(is_boolean($value)){loop;}
if(is_integer($value)){loop;}
if(is_float($value)){loop;}
if(is_double($value)){loop;}
}
Dont see a reason NOT to use
switchhere.You can completely omit
continue;, if theswitch-statement is the only one within theforeach-loopUpdate (after the update of the question):
The
switch-statement is still useable (and in my opinion more readable)As long as the code simply does nothing you can also simplify it a little bit.