tryingtolearn Posted August 5, 2007 Share Posted August 5, 2007 Is it possible to make this jump in increments of 10 instead of 1 in the dropdown??? I have a feeling Im missing something right in front of me. <?php echo '<select name="rate">'; $rate = 10; while ($rate <= 1000) { echo "<option value=\"$rate\">$rate</option>\n"; $rate++; } echo '</select><br />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63402-solved-incrementing-by-more-than-1-at-a-time/ Share on other sites More sharing options...
php_joe Posted August 5, 2007 Share Posted August 5, 2007 <?php echo '<select name="rate">'; $rate = 10; while ($rate <= 1000) { echo "<option value=\"$rate\">$rate</option>\n"; $rate = $rate + 10; } echo '</select><br />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63402-solved-incrementing-by-more-than-1-at-a-time/#findComment-315994 Share on other sites More sharing options...
dustinnoe Posted August 5, 2007 Share Posted August 5, 2007 <?php echo '<select name="rate">'; $rate = 10; while ($rate <= 1000) { echo "<option value=\"$rate\">$rate</option>\n"; $rate = $rate + 10; } echo '</select><br />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63402-solved-incrementing-by-more-than-1-at-a-time/#findComment-315995 Share on other sites More sharing options...
tryingtolearn Posted August 5, 2007 Author Share Posted August 5, 2007 Well now - I guess that makes total sense Thanks for the replys. Quote Link to comment https://forums.phpfreaks.com/topic/63402-solved-incrementing-by-more-than-1-at-a-time/#findComment-315996 Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 A short alternative to $rate = $rate + 10 is $rate += 10; Quote Link to comment https://forums.phpfreaks.com/topic/63402-solved-incrementing-by-more-than-1-at-a-time/#findComment-316049 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.