06
2019
02

PHP continue

  continue 在循环结构用用来跳过本次循环中剩余的代码并在条件求值为真时开始执行下一次循环

  continue 接受一个可选的数字参数来决定跳过几重循环到循环结尾。默认值是 1,即跳到当前循环末尾

$i = 0;

while ($i++ < 5) {

    echo "Outer<br />\n";

    while (1) {

        echo "Middle<br />\n";

        while (1) {

            echo "Inner<br />\n";

            continue 3;

        }

        echo "This never gets output.<br />\n";

    }

    echo "Neither does this.<br />\n";

}

原文链接:https://www.qiquanji.com/post/8869.html

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

微信扫码关注

更新实时通知

« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。