"; foreach($a as $item) { if($item % 3 == 0){ echo "$item
"; } } $max = sizeof($a); for($i = 0;$i<$max;$i++) { if($a[$i]%3==0) echo $a[$i]."
"; } ?>