Within a for loop, i need to add some HTML that outputs only when the loop is on a [(multiple of 3) minus 1].
For example, what i could do is:
for($i=0;
Use the modulus operator.
if (! (($i+1) % 3) ) {
If $i+1 divides into 3 with no remainder, the result will be zero. Then you just need a boolean not.
If you want to match 0 as well (since you use it in your example, but it doesn't match your description) then you will have to special case it with an ||.