continue:跳出本次循环
break:终止循环
exit:用来结束程序执行
return: 用来结束一段代码
$arr= array('le','yang','jun','lecode','gagade');
$html= '';
foreach($arr as $key => $value){
if($value=='b'){
$html.= $value;
continue;// 当 $value为b时,跳出本次循环
}
if($value=='c'){
$html.= $value;
break;// 当 $value为c时,终止循环
}
$html.= $value;
}
echo $html; // 输出: abc
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END


![表情[ciya]-红穆笔记](https://www.4s5.cn/wp-content/themes/zibll/img/smilies/ciya.gif)
![表情[xia]-红穆笔记](https://www.4s5.cn/wp-content/themes/zibll/img/smilies/xia.gif)


暂无评论内容