我有以下循环,我想在内循环内的检查满足条件时继续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;
- }
- }
当内部循环被打破时,PHP是否有自己的构建方式来继续主循环?