Break is used in the various loops and switch statements mentioned above. His role is to jump out of the current syntax structure and execute the following statement. The break statement can take a parameter n, which indicates the number of layers
The loop structure in PHP has roughly a for loop, while loop, do{} while loop and several foreach loops, regardless of the loop, in
There are several ways to jump out of a loop in PHP:Code:
Copy CodeThe code is as follows:
$i = 1;
while (true)
The break statement for JS programming syntax:The break statement causes the running program to immediately exit the loop that is contained in the inner layer or exit a switch statement.Since it is used to exit a loop or switch statement, this form
Example of using php loop statement to control break and continue
This article describes how to use php to jump out of the loop break and skip a certain layer of loop continue. For more information, see.This article will show you how to use
This article describes the use of PHP to jump out of the loop break, and skip a layer of cyclic continue specific usage, with the need for a friend reference.This article leads you to understand the use of break and continue, and their role in
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------"Loop Structure"1 , circular structure Introduction:Loops are executing the same block of code again and again2. Several conditions
4.3.3 for Loop: Within a range ... Each of them ...Since the while statement and Do...while ... Statements have been able to meet the needs of our expression loop phenomenon, why should C + + specifically provide a For statement to express the loop
20.10 for Loop
Syntax: for variable name in condition; Do ...; Done
;案例1[[email protected] shell]# cat for.sh#!/bin/bashsum=0for i in `seq 1 100`do sum=$[$sum+$i]doneecho $sum#输出的结果[[email protected] shell]# sh for.sh 5050
4.3.3 for Loop: Within a range ... Each of them ...Since the while statement and Do...while ... Statements have been able to meet the needs of our expression loop phenomenon, why should C + + specifically provide a For statement to express the loop
The word "break" is not unfamiliar, the most common is in the switch statement.If you forget to break after the case of switch, the corresponding statement to the next case is executed sequentially.I said this is only for C + +, C sharp If you
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.