在php中,continue 在循环结构中用来跳过本次循环中剩余的代码并开始执行下一次循环。这一点和其他语言是一致的,不过,另有妙处:continue 接受一个可选的数字参数来决定跳过几重循环到循环结尾。
#php_continue.php $i = 0; $j = 0; while ($i++ 3) {//level 3 echo outer n; while (1){//level 2 echo middle n; while (1){//level 1 echo inner n; continue 3; } echo thisnever gets output. n; } echoneither does this. n; $j++; //after runscontinue 3,it comes to the end of level 3 } echo$j=$j;//output: $j=0 ?>
以上这段代码,就是php函数continue的具体用法,希望对大家有所帮助。
http://www.bkjia.com/phpjc/446358.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/446358.htmltecharticle我们在实际的 php函数continue与众不同之处在于接受一个可选的数字参数来决定跳过几重循环到循环结尾。 在php中,continue 在循环结构中用来...
