Copy the code The code is as follows:
//The current loop of php is 1, and the loop increases from the inside to the outside. The default break is 1. For example, jump out of the second level loop
for ($i=0;$i<3;$i++){
foreach (array(1,2,3) as $val){
foreach (array( 1,2,3) AS $ Val) {
Echo "1 layer of cycle & lt; br/& gt;";
Break 2; // Jump out of the second layer of loop
}
echo "2 Layer loop
";
}
echo "3-layer loop
";
}
//Result:
//1-layer loop
//3-layer loop
//1-layer loop
//3-layer loop
//1-layer loop
//3-layer loop
http://www.bkjia.com/PHPjc/327959.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327959.htmlTechArticleCopy code The code is as follows: //php current loop is 1, the loop increases from inside to outside, break defaults to 1. For example, jump out of the second level loop for ($i=0;$i3;$i++){ foreach (array(1,2,3) as $val){...