我们假设我用这个
获得了一周中的某一天$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
答案 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];
?>