Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在给定月份后获取月份名称。所以六月,我想要七月
我试过了:
$next_month = date('F',strtotime('June', "next month"));
这个显示一月,这显然是错误的,我正在寻找七月。
那么我将如何获得前一个月?
我试过了
$prev_month = date('F',strtotime('June - 1 month'));
$next_month = date('F',strtotime('June + 1 month'));
或者
$next_month = date('F',strtotime('June next month'));
编辑
$next_month = date('F',strtotime('June last month'));
echo date('F',strtotime('June + 1 month'));