【发布时间】:2015-12-05 18:41:11
【问题描述】:
我有以下循环,当内部循环内的检查满足条件时,我想continue while 循环。我找到了一个解决方案here(我在下面的例子中应用了这个),但它适用于c#。
$continue = false;
while($something) {
foreach($array as $value) {
if($ok) {
$continue = true;
break;
// continue the while loop
}
foreach($value as $val) {
if($ok) {
$continue = true;
break 2;
// continue the while loop
}
}
}
if($continue == true) {
continue;
}
}
当内部循环已经被break-ed out 时,PHP 是否有自己构建的方式来continue 主循环?
【问题讨论】:
标签: php loops nested break continue