I have an array of n elements, of the form:
array (
array ("FOO", "BAR"),
array ("FOO", "BAR"),
array ("FOO", "BAR")...
)
I would like to loop over the array and display them on an HTML table.
<? $bigArray = array( array("foo", "bar"), array("foo", "bar"), array("foo", "bar") ); ?>
<table>
<? foreach($bigArray as $a) { ?>
<tr><? for($j=0; $j <= 5; ++$j) { ?><td><?= $a[$j] ?></td><? } ?></tr>
<? } ?>
</table>
The advantage of this approach is that you can prototype with your favorite html editor and plug the commands in. Note that this only works when your server supports short_tags.
5 with your bound (i.e. $j < $max_elements)