Get a list of this week dates [duplicate]
Possible Duplicate:
how to find the dates between two dates specified
I want to get todays date and the following 6 days. I wish to display it as an html list. So say today date is the 1st October I would like to ret开发者_运维问答urn.
<ul>
<li>01/10/2011</li>
<li>02/10/2011</li>
<li>03/10/2011</li>
<li>04/10/2011</li>
<li>05/10/2011</li>
<li>06/10/2011</li>
<li>07/10/2011</li>
</ul>
From the PHP Documentation:
It is possible to use date() and mktime() together to find dates in the future or the past.
<?php
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$nextyear = mktime(0, 0, 0, date("m"), date("d"), date("Y")+1);
?>
See here.
精彩评论