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;
}
}
}
http://www.bkjia.com/PHPjc/945710.htmlwww.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...