提交几个月后我的代码是否存在表单错误时,我试图将值保留在select标记(for循环)中
<div class="form-group col-lg-2">
<label style="color:transparent;" id="test_color">h</label>
<select name="month" id="month" class="form-control">
<option value="">Month</option>
<?php for($m=1; $m<=12; ++$m): ?>
<option value="<?=date('F', mktime(0, 0, 0, $m, 1));?>"<?php if (isset($month) && $month==$m) echo "selected";?>>
<?=date('F', mktime(0, 0, 0, $m, 1));?></option>
<?php endfor; ?>
</select>
</div>
但这不起作用...