strtotime'下个月'没有按预期行事(今天是)

Moa*_*oak 2 php date

这只发生在31日到目前为止

echo date('F',strtotime('this month')); //May
echo date('F',strtotime('next month'));//July
echo date('F',strtotime('+1 month'));//July
Run Code Online (Sandbox Code Playgroud)

据我所知,六月是五月之后.但是我猜想从现在开始增加31天后,php就变得懒惰了,整整一个月都没有了.

无论长度如何,我怎样才能安全地获得下个月?理想情况下使用strttotime

编辑忘了提,为什么我希望使用strtotime是我使用搜索框来查找解释用户输入strtotime的事件

dec*_*eze 6

最强大的方式可能是:

date('F', mktime(0, 0, 0, date('n') + 1, 1))
Run Code Online (Sandbox Code Playgroud)