mardi 3 août 2021

How to list values in a range with two known numbers PHP

I have two entries in my DB, for example 0.003 and 0.007. I need to print numbers in between i.e 0.004,0.005,0.006. It could be whole numbers as well, 5,7,120 (all numbers with positive sign). How can I do this in PHP? Thank you!

For whole numbers:

for ($x = 5; $x <= 8; $x++) { echo "The number is: $x
"; }

But how can I do incrementation with decimals?




Aucun commentaire:

Enregistrer un commentaire