<?PHP $columns = 3; $im = glob("*.{gif,jpg,png}", GLOB_BRACE); $rows = ceil(count($im) / $columns); for ($i = 0; $i < $rows; $i++) { echo "\n<TR>"; for ($j = $columns*$i; isset($im[$j]) && $j - $columns*$i < $columns; $j++) { echo "<TD>$im[$j]<BR><IMG SRC='$im[$j]'></TD>"; } echo "</TR>"; } ?>
You need to create an account or log in to post comments to this site.