我创建了一个下拉选择列表,它根据当前日期生成日期列表,
4 天前和 7 天前,我尝试了几个较短的脚本,但都失败了,我一直在使用以下脚本,但它有一些限制......谢谢!
<option value=""> select </option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-4),date("Y")));?>" style="color:red;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-4),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-3),date("Y")));?>" style="color:red;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-3),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-2),date("Y")));?>" style="color:red;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-2),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-1),date("Y")));?>" style="color:red;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")-1),date("Y")));?></option>
<option value="<?php echo date ('m/d/Y');?>"><?php echo date ('m/d/Y');?> TODAY </option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+1),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+1),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+2),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+2),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+3),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+3),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+4),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+4),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+5),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+5),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+6),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+6),date("Y")));?></option>
<option value="<?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+7),date("Y")));?>" style="color:green;font-weight:bold;"><?php echo date ("m/d/Y", mktime (0,0,0,date("m"),(date("d")+7),date("Y")));?></option>