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
This article provides a detailed analysis of the PHP bounce loop method and the differences between continue, break, and exit. For more information, see
This article provides a detailed analysis of the PHP bounce loop method and the differences
The loop structure in PHP has roughly the for loop, while loop, do{} while loop, and the Foreach Loop, no matter which loop, there are several ways to jump out of the loop in PHP:Code:
Copy Code code as follows:
$i = 1;
while (true) {//This
Break ends the execution of the current for, foreach, while, do-while or switch structure. The break can accept an optional numeric parameter to determine the number of loops to jump out.
Break
(PHP 4, PHP 5)
Break ends the execution of the current
The following examples illustrate
Break is used to jump out of the current execution loop and no longer executes the loop.
Copy the Code code as follows:
$i = 0;while ($i if ($arr [$i] = = "Stop") {Break}$i + +;}?>
Continue immediately stops
The loop structure in PHP has roughly a for loop, while loop, do{} while loop, and a foreach loop, in either loop,
There are roughly a few ways to jump out of a loop in PHP:Code:
Copy Code code as follows:
$i = 1;
while (true)
This article provides a detailed analysis of PHP's method of jumping out of the loop and the differences between continue, break, and exit. for more information, see the for loop structure in PHP, while loop, do {} while loop, and foreach loop.
PHP
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 process control commands break and continue in PHP are parsed. The break and continue process control commands in PHP are parsed into 0a0, b0b0, c0c0, d0d0, e0e0 ,); * ******** break ******** is used to jump out of the current execution cycle,
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.