Reemplaza el for por tu while:
Código PHP:
Ver original<?php
$fotos = array(1,2,3,4,5,6,7,8,9,0,11,12,13,14,15); $limite = 4;
$table = "<table>";
for($i = 1;$i<count($fotos);$i++){ if($i%$limite==1)$table .="<tr>";
$table .= "<td>{$fotos[$i]}</td>";
if($i%$limite==0)$table .="</tr>";
}
$table .= "</table>";
echo $table;
?>
Saludos