We are in the actualPHP function Continue is unique in that it takes an optional numeric parameter to decide to skip a few loops to the end of the loop.
In PHP, continue is used in the loop structure to skip the remaining code in the loop and start the next loop. This is consistent with other languages, but there is another beauty: Continue accepts an optional numeric parameter to decide to skip a few loops to the end of the loop.
- #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 ";
- }
- echo "Neither does this.
- n ";
- $j + +;
- After Runscontinue 3,it comes to the end of level 3
- }
- echo "$ J = $j ";//output: $ J = 0
- ?>
The above code, is the PHP function continue the specific use, I hope to help you.
http://www.bkjia.com/PHPjc/446358.html www.bkjia.com true http://www.bkjia.com/PHPjc/446358.html techarticle What differentiates us from the actual PHP function continue is that we accept an optional numeric parameter to decide to skip a few loops to the end of the loop. In PHP, continue is used in the loop structure to ...