SyntaxFix
Write A Post
Hire A Developer
Questions
Use the modulo arithmetic operation found here in the PHP manual.
e.g.
$x = 3; for($i=0; $i<10; $i++) { if($i % $x == 0) { // display image } }
For a more detailed understanding of modulus calculations, click here.