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> Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/79674-problems-with-array/#findComment-403490 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.