: This article mainly introduces PHP learning (9)-Special process control statements. if you are interested in the PHP Tutorial, refer to it. Special process control statements
If you want to implant a loop during the execution of the loop body, or skip some cycles to continue executing other cycles, you need some special process control statements.
1. break statement
Break can end the execution of the current for, foreach, whiel, do-while, or switch structure.
2. continue statement
The continue statement can only be used within the loop statement. The function is to skip this loop and continue to execute the next loop structure. In the while and do-while statements, the continue statement jumps to the exit of the loop condition and continues execution. for the for loop, the floral action is variable update.
The continue function is as follows:
(1) like a break statement, a continue statement is usually used in a loop. you can also accept an optional number parameter to decide to exit multiple statements.
(2) If a continue statement is encountered in a loop, no statement is executed after the continue statement in the loop.
(3) the continue statement ends the grade loop and continues the next loop.
3. exit statement
In the current script, you only need to execute the exit statement, no matter which structure it is in, it will directly exit the current script. Exit () is a function that outputs a message with a parameter and exits the current script.
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces PHP learning (9)-Special process control statements, including some content, and hope to be helpful to friends who are interested in PHP tutorials.