Ver original$i = 0; while ($i < $cantidad) { if ( (($i%3) < 1) && ($i>0) ){ echo "<br />"; } echo $imagenes[$i]." "; $i++; }