I am new to PHP and saw the code below online. It has continue 2
and break
together in switch/case
statement. What does it mean?
foreach ( $elements as &$element ) {
switch ($element['type']) {
case a :
if (condition1)
continue 2;
break;
case b :
if (condition2)
continue 2;
break;
}
// remaining code here, inside loop but outside switch statement
}