echo "<br>当日开始(零点零分):" . strtotime(date('Y-m-d'));
echo "<br>";

echo time();

echo "<br>当日开始(零点零分):" . strtotime(date('Y-m-d',time()));
echo strtotime(date('Y-m-d'));
echo "一周后:".date("Y-m-d",strtotime("+0 week"));
echo "<br>本周开始:" . date('Y-m-d', strtotime('this week'));
echo "<br>本周结束:" . date('Y-m-d', strtotime('last day next week +1 day'));
echo "<br>本周开始:" . strtotime(date('Y-m-d', strtotime('this week')));//时间戳
echo "<br>本周结束:" . strtotime(date('Y-m-d', strtotime('last day next week +1 day')));

1.PHP获取未来一周的时间

public function getWeek()
{
for($i=0;$i<7;$i++)
{
$arr[$i]=date('Y-m-d',strtotime(date('Y-m-d').'-'.$i.'day'));
}

return json($arr);
}

2.PHP获取本周每一天的时间 

public function getDay()
{
$timestr = time(); //当前时间戳
$now_day = date('w',$timestr); //当前是周几

//获取周一
$monday_str = $timestr - ($now_day-1)*60*60*24;
$monday = date('Y-m-d', $monday_str);

//获取周日
$sunday_str = $timestr + (7-$now_day)*60*60*24;
$sunday = date('Y-m-d', $sunday_str);

for($i=0;$i<7;$i++)
{
$arr[$i]=date('Y-m-d',strtotime($monday.'+'.$i.'day'));
}
return json($arr);
// echo "星期一: $monday\n";
// echo "星期天: $sunday\n";
}

效果:

["2018-06-11","2018-06-12","2018-06-13","2018-06-14","2018-06-15","2018-06-16","2018-06-17"]

3.PHP获取下一个月时间

date("Y-m-d H:i:s")//当前时间:2021-05-29 11:40:57

date("Y-m-d H:i:s", strtotime(" +1 month")//下个月时间:2021-06-29 11:40:57

date("Y-m-d H:i:s", strtotime("2021-5-1 06:06:06 +1 month")) //指定下个月时间:2021-06-01 06:06:06