phpretard Posted September 26, 2008 Share Posted September 26, 2008 I need some formula that will take this set of radio button and increment them up. The name should start at $i=1; and end at $max=31; $values=1 to 4; The only only real value that needs to change is "value" I know there is an easy script for this I just can't get it put together and I'm embarrassed to show my work thus far. My brain hurts trying to figure this. In theary I believe since the value is simply 1 to 4 I could set a variable (minimum maximum for that). The name is 1 - 32 I could set a variable (minimum maximum for that) The loop Help me... <input type="radio" name='1' value=1> 1 <input type="radio" name='1' value=2> 2 <input type="radio" name='1' value=3> 3 <input type="radio" name='1' value=3> 3 <input type="radio" name='1' value=4> 4 <input type="radio" name='2' value=1> 1 <input type="radio" name='2' value=2> 2 <input type="radio" name='2' value=3> 3 <input type="radio" name='2' value=3> 3 <input type="radio" name='2' value=4> 4 This just repeats up to 32 inside of a table Could someone get me started. I'll be searching until then. Thanks! Link to comment https://forums.phpfreaks.com/topic/125940-solved-max-and-i/ Share on other sites More sharing options...
sasa Posted September 26, 2008 Share Posted September 26, 2008 try for($i = 1; $i < 32; $i++){ for($value = 1; $value < 5;$value++){ echo "<input type="radio" name='$i' value=$value> $value "; } echo "<br />\n"; } Link to comment https://forums.phpfreaks.com/topic/125940-solved-max-and-i/#findComment-651212 Share on other sites More sharing options...
phpretard Posted September 26, 2008 Author Share Posted September 26, 2008 How do you do it? Thank you!!!! Link to comment https://forums.phpfreaks.com/topic/125940-solved-max-and-i/#findComment-651219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.