PHP learning (9) -- Special process control statements

Source: Internet
Author: User
: 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.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.