gc40 Posted December 1, 2007 Share Posted December 1, 2007 Can anyone tell my why this would not work: <select name="day" id="day"> <?php $selected = $onenav->day; for ($i = 1; $i <= 31; $i++) { foreach ($i as $key => $val) { $disabled = $key == $selected ? "SELECTED" : ""; echo "<option $disabled value=\"$key\">$val</option>"; } } ?> </select> Link to comment https://forums.phpfreaks.com/topic/79674-problems-with-array/ Share on other sites More sharing options...
BlueNosE Posted December 1, 2007 Share Posted December 1, 2007 nmm, "foreach $i"? $i is an intiger, not an array. Link to comment https://forums.phpfreaks.com/topic/79674-problems-with-array/#findComment-403490 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.