Okay, so I'm writing an application. In this application there is a drop down with the selections 10, 20, 30, and so on to 100. This drop down controls the amount of times a loop will occur. Basically, every time the application gets to a loop that is 10% of the total amount of loops, I want it to echo out a small line. On the user end this outputs a small block in a progress bar.
For example if you choose 10, then every loops it would output a block on the progress bar to give us 100%.
If you choose 20, every 2 loops it would output a block on the progress bar to give us 100%.
The easy way out would be to make a huge case select of if, elseif statement, but that's not what I want to do.
As an example, if you choose 10 ($amount = 10), it works correctly. $i is the increment of the loop.
echo ($i % ($amount / 10) == 0) ? "<div class=\"load\"></div>" : "";
I know that's very confusing, but hopefully someone can understand and give me some mathematical help. :P