<?php
$arr = array('aaa','bbb','ccc','ddd','eee');
$texti = 0;
$text = '';
function havePost() {global $arr,$texti,$text; if (isset($arr[$texti])) {$text = $arr[$texti]; ++$texti; return true;} else {return false;}}
function thePost() {global $text; echo $text;}
echo '<table border=1>';
$bool = true;
while ($bool==true)
{
echo '<tr>';
$i = 0;
while ($i<3 && ($bool=havePost())==true)
{
echo '<td>'; thePost(); echo '</td>';
++$i;
}
echo '</tr>';
}
echo '</table>';
?>
A kdybys tam chtel doplnit dalsi policka, tak tam ten cyklus zopakujes s pricitanim icka bez detekce havePost a bez vypisovani clanku.