选择下拉有一个简单的if语句为默认从下拉正确的日期?因此,例如,如果日期是02/11/16
然后它会默认选择 01/28/16
基本上我要求的是一个声明,如果默认选择的下拉该日期内从日期范围
<?php
date_default_timezone_set('US/Eastern');
$currenttime = date('d:m:y:h:i:s A');
list($day,$month,$year) = split(':',$currenttime);
$currentdate = "$month/$day/$year";
?>
<form>
<select>
<option>01/14/16</option>
<option>01/28/16</option>
<option>02/14/16</option>
///the list goes on for ages so i saved time and cropped out the rest of the dates.
</select>
</form>
你将如何决定它是在计费周期? –
你为什么不只是做'$的currentdate =日期( “M/d/Y”)',而不是分裂的时间? – Barmar
@Sougata看起来帐单期限是菜单中日期之间的范围。 – Barmar