I am looking for a way to populate an option value.
<?php for ($i = 1; $i <= 300; $i++) : ?>
<option value="<?php echo $i; ?>">1.<?php print $i; ?> AVAX</option>
<?php endfor; ?>
I want for the above code to work something like this. 1.00 - 1.99
after reaching 1.99
I want it to navigate to 2.00 - 2.99
and so forth and onward until the numbers run out. How can I achieve that? The above result returns only 1.300
2
Answers
You can set the increment to whatever you want
demo
What do you mean by
until numbers run out?
You do realize that numbers are infinite.
Therefore, I can only assume that you want the options to have the series:
1.01, 1.02…. 1.99, 2.00, 2.01, 2.02, …. until 10.00.
If 10 is not the highest number you want to reach, then you can change the end limit of $i in the following code: