<?php $array = array(1,2,3,4,5,6); echo '<table><tr>'.chr(10); for($i=0;$i<count($array);$i++) { if($i % 2 == 0 and $i != 0) echo '<tr></tr>'.chr(10); echo '<td>'.$array[$i].'</td>'.chr(10); } echo '</tr></table>'.chr(10); ?>
<?php echo '<table border="1">'; for ($i=1; $i<= 6;) { echo '<tr><td>'.$i.'</td><td>'.($i+1).'</td></tr>'; $i = $i+2; } echo '</table>'; ?>