continue:跳出本次循環
break:終止循環
exit:用來結束程序執行
return: 用來結束一段代碼
$arr= array('le','yang','jun','lecode','gagade'); $html= ''; foreach($arras $key => $value){ if($value=='b'){ $html.= $value; continue;// 當 $value為b時,跳出本次循環 } if($value=='c'){ $html.= $value; break;// 當 $value為c時,終止循環 } $html.= $value; } echo $html; // 輸出: abc