PHP continue 关键字
示例
使用 continue
跳过循环中的“5”部分代码
<?php
for($i = 1; $i <= 10; $i++) {
if($i == 5) {
continue;
}
echo "$i <br>";
}
?>
自己动手试一试 »
定义和用法
The continue
keyword is used to is used to end the current iteration in a for
, foreach
, while
or do..while
loop, and continues to the next iteration.
相关页面
Use the break
keyword to end the loop completely
Read more about break and continue in our PHP Break and Continue Tutorial.
在我们的 PHP 循环教程 中阅读有关循环的更多信息。
❮ PHP 关键字