php looping array - html table -
i have array of n
elements, of form:
array ( array ("foo", "bar"), array ("foo", "bar"), array ("foo", "bar")... )
i loop on array , display them on html table.
<? $bigarray = array( array("foo", "bar"), array("foo", "bar"), array("foo", "bar") ); ?> <table> <? foreach($bigarray $a) { ?> <tr><? for($j=0; $j <= 5; ++$j) { ?><td><?= $a[$j] ?></td><? } ?></tr> <? } ?> </table>
the advantage of approach can prototype favorite html editor , plug commands in. note works when server supports short_tags.
Comments
Post a Comment