phppup Posted February 23, 2012 Share Posted February 23, 2012 If I use this code: $values = range(0, 10); echo "<select name=\"my_field\">\n"; foreach($values as $v) { echo "<option value=\"$v\">$v</option>\n"; }echo "</select>\n"; to generate a dropdown, it will offer options from 1 thru 10. Is there any way to make them increment by .50 (ie: 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, etc.? Link to comment https://forums.phpfreaks.com/topic/257631-building-a-dropdown/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 23, 2012 Share Posted February 23, 2012 Of course you can. Did you read the documentation for range Link to comment https://forums.phpfreaks.com/topic/257631-building-a-dropdown/#findComment-1320449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.