stuck with phptime function
What i am trying to achive is return something like this.
day1 day2 day3 ... day7 Today, as in today's date should be equal to day1, tomorrow, should be equal to day 2 and the same applies until day7.
What i have written so far is this but i am stuck and not sure how to proceed.
function future_date (){
$numDays=7;
for($i开发者_StackOverflow社区=0; $i<$numDays; $i++) {
$futuredate = date('d-m-Y', strtotime('+' . strval($i) . ' days'));
print $futuredate;
return $futuredate;
}
}
If I gather your requirements based on your comment, you just need to format the date differently. That means you need to change the 'd-m-Y'
string. Take a look at date()
.
The day of the week can be represented by a lowercase L date('l')
.
精彩评论