【发布时间】:2013-12-24 20:03:45
【问题描述】:
我想生成一个表单,它有一个下拉选项框,其中包含按顺序和格式排列的日期,但我不知道如何将它们显示为字符串。
我假设您需要做这种事情来获得开始和结束,但我怎样才能获得每个“选项”的日期?
<?php
date_default_timezone_set('UTC');
$start = date('Ymd');
$end = date('Ymd', strtotime('+60 days'));
while (strtotime($start) <= strtotime($end)) {
echo "$start\n";
$date = date ("Ymd", strtotime("+1 day", strtotime($start)));
}
?>
【问题讨论】:
标签: php