Given that:
$min=30
$max=60
(min and max being variables that are rounded either to the nearest 5 or 10)
How do you generate an output that counts in five within the min and max range in a table format?
For example with the above example you would get an output of:
cname | -------| 30 | -------| 35 | -------| 40 | -------| 45 | -------| 50 | -------| 55 | -------| 60 | -------|
Minor variant on the above answers
foreach(range($min,$max,5) as $value) {
// do whatever
}
for ($i = 30; $i <= 50; $i+=5) {
echo $i;
}
For more information have a look here: http://php.net/manual/en/control-structures.for.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With