Example of using break to jump out of multiple loop codes in PHP, phpbreak_PHP tutorial

WBOY
Release: 2016-07-13 10:09:27
Original
738 people have browsed it

Examples of using break to jump out of multiple loop codes in PHP, phpbreak

Copy code The code is as follows:

$array = array(1,2,3,4,5,6);
for($i=0;$i<10;$i++){
foreach($array as $key)
{
echo $key;
if($key==2){

Break 2;
}
}
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/945710.htmlTechArticleUse break to jump out of multiple loop code examples in PHP. The phpbreak copy code is as follows: $array = array(1,2 ,3,4,5,6); for($i=0;$i10;$i++){ foreach($array as $key) { echo $key; if($key...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template