1 2 3 4 5 6 7 8 9 10 11 12
<?php $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 2; break; } echo "$item<br>"; } ?>
1
bar<br>bar<br>