香港專業教育學院創建了一個下拉選擇列表,其基於當前日期日期列表,構建選擇列表
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>
你可以縮小你的代碼示例到相關部分(也許使用省略號來表示重複)?此外,這有什麼限制? –
你找到了什麼限制?你真的沒有在這裏問過一個問題... – EmmyS
請原諒我的簡潔,這是相當繁瑣的,我試圖比較它在數據庫中的價值,此外,我必須把它放到非常小的形式如果我搞砸了,只是需要輸入很多重複的代碼,而且我一直試圖嘗試一些我發現的例子,但是一直出錯 – Ichimonban