获取明天的日期(“l”)PHP

时间:2017-09-23 10:18:56

标签: php date

我们假设我用这个

获得了一周中的某一天
$monday = date("l");

虽然有效,但现在,我希望接下来的两天如

$date = ("Y-m-d");
$tuesday = date('l', strtotime('+1 day',$dateaa));
$wednesday = date('l', strtotime('+3 day',$dateaa));

但是当我回复Monday Monday$tuesday时,我得到$wednesday

2 个答案:

答案 0 :(得分:1)

你确定吗?

$dateaa = strtotime('last sunday');
echo $wednesday = date('l', strtotime('+3 day', $dateaa)); // wednesday

$dateaa = strtotime('last monday');
echo $thursday = date('l', strtotime('+3 day', $dateaa)); // thursday

答案 1 :(得分:0)

试试这个

<?php
$days = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
$today = date('w');
$nextTwoDay = $today + 2;
if ($nextTwoDay > 6) $nextTwoDay = $nextTwoDay - 6;
echo $days[$nextTwoDay];
?>