[ create a new paste ] login | about

Link: http://codepad.org/oxA4nM9v    [ raw code | output | fork ]

barmar - PHP, pasted on Oct 26:
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>";
    }
?>


Output:
1
bar<br>bar<br>


Create a new paste based on this one


Comments: