PHP日历显示预览和下一个按钮

时间:2014-08-04 05:36:32

标签: php calendar

我的代码只显示当月的星期一。

如何使用以下代码输入下个月和上个月按钮。

$startDate  = "2014-08-01";
$endDate = "2014-09-26";


$endDate = strtotime($endDate);
echo '<table border=1>';
echo '<tr>';
for($i = strtotime('Monday', strtotime($startDate)); $i <= $endDate; $i = strtotime('+1 week', $i))

    echo '<td>'.date('d-M-y', $i).'</td>';   

echo '</tr>';   
echo '</table>';

这是代码的输出

04-Aug-14   11-Aug-14   18-Aug-14   25-Aug-14   01-Sep-14   08-Sep-14   15-Sep-14   22-Sep-14

0 个答案:

没有答案