PHPforeach()跳出本次或當前循環與終止循環方法

PHP中用foreach()循環中,想要在循環的時候,當知足某個條件時,想html $arr = array('a','b','c','d','e'); $html = ''; foreach($arr as $key => $value){ if($value=='b'){ $html .= $value; continue; // 當 $value爲b時
相關文章
相關標籤/搜索