Switch, while, and so on are all very common PHP loops, which can be used well. It is very good for PHP programs with strong logic. Break is a jump out loop, while continue is the next loop. There are many things in the manual. The most important thing is how to apply them to practice. The following are the extracted parts of the continue in
Switch, while, and so on are all very common PHP loops, which can be used well. It is very good for PHP programs with strong logic. Break is a jump out loop, while continue is the next loop. There are many things in the manual. The most important thing is how to apply them to practice. The following are the extracted parts of the continue in
Switch, while, and so on are all very common PHP loops, which can be used well. It is very good for PHP programs with strong logic. Break is a jump out loop, while continue is the next loop. There are many things in the manual. The most important thing is how to apply them to practice.
The following are excerpted parts
Continue is used in the loop structure to skip the remaining code in this loop and start to execute the next loop when the condition value is true. Continue accepts an optional numeric parameter to decide to skip multiple cycles to the end of the loop.
\n"; while (1) { echo " Middle
\n"; while (1) { echo " Inner
\n"; continue 3; } echo "This never gets output.
\n"; } echo "Neither does this.
\n"; } ?>
Omitting the semicolon after the continue will lead to confusion. The following example shows that you should not do this.
The expected result is:
0 1 3 4
The actual output is: 2.