$arr = array('not want to print','foo','bar');
foreach($arr as $item) {
switch($item) {
case 'foo':
$item = 'bar';
break;
case 'not want to print':
continue;
break;
}
echo $item;
}
但是输出了“
not want to print
”。为什么continue语句没有作用于foreach循环中呢?
http://codepad.org/WvW1Fmmo
switch
。这是真正的代码还是复制错误? - Barmar