I noticed that continue would not work within a switch statement too, for example :
<?php
$names = array("Mike", "Mary", "Jose", "Anna");
foreach ($names as $kid) {
switch($kid) {
case "Mike":
case "Anna": continue; break;
}
echo $kid."<br />";
}
?>
This will NOT work as expected. It will produce:
Mike
Mary
Jose
Anna
BUT, if you specify the level of brackets to jump out of for the continue it will work as expected. So you should have the following code:
<?php
$names = array("Mike", "Mary", "Jose", "Anna");
foreach ($names as $kid) {
switch($kid) {
case "Mike":
case "Anna": continue 2; break;
}
echo $kid."<br />";
}
?>
This WILL work as expected: It will produce:
Mary
Jose
Luck,
-Nika