PHP Learning (ix)--Special flow control statements

Source: Internet
Author: User
Special Process Control Statements

Special Process Control statements are required if you want to plant loops during loop body execution, or to skip some loops to continue with other loops.

1. Break statement

Break can end the execution of the current for, foreach, Whiel, do-while, or switch structures.

2. Continue statement

The continue statement can only be used inside a loop statement, and the function is to skip the loop and continue with the next loop structure. In the while and Do-while statements, the continue statement jumps to the loop condition to begin execution, and the action for the For loop floral is a variable update.
The continue functions are as follows:
(1) Like the break statement, the continue statement is usually used in loops, or it can accept an optional numeric parameter to decide to jump out of multiple statements.
(2) After encountering the continue statement in the loop, no statement after the continue in the loop is executed.
(3) The Continue statement is used to end the grade cycle and continue the next cycle.

3. Exit statement

The current script simply executes to the exit statement, regardless of which structure it is in, and exits the current scripts directly. Exit () is a function that can output a message with one parameter and exit 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); }); });

    The above describes the PHP learning (ix)-Special Process control statements, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.