?>
<table>
<tr>
<? $z = 1; foreach($arrayNums as $item): ?>
<td>
<?=$item?>
</td>
<?if ($z % 4 == 0): ?>
</tr><tr>
<? endif; ?>
<?$z++; endforeach; ?>
</tr>
</table>
<?