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 />'; ?> 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 />'; ?> 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 />'; ?> 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. 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; 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
Archived
This topic is now archived and is closed to further replies.