I have a json file with an array of over 100 images
foreach($images as $image)
{
$imagelink = $image[\'link\'];
echo
How about this:
echo "<table>";
$col = 0;
$maxCols = 4;
foreach($images as $image)
{
// first row, or we've already output the max number of images per row so start a new one
if( $col % $maxCols == 0 ) {
// we need to end a previously started row
if( $col != 0 ) {
echo "</tr>";
}
echo "<tr>";
}
$imagelink = $image['link'];
echo "<td><img src=$imagelink></td>";
$col++;
}
// we didn't end the last row we started
if( $col != 0 ) echo "</tr>";
echo "</table>";