继续 2 并中断开关语句
2022-08-30 11:53:11
我是PHP的新手,在网上看到了下面的代码。它有并在声明中共同。这是什么意思?continue 2
break
switch/case
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
}