如何在给定月份后获取月份名称。所以对于六月,我想要七月
我试过了:
$next_month = date('F',strtotime('June', "next month"));
这显示一月,这显然是错误的,我正在寻找七月。
我怎么能在前一个月获得?
我试过了
$prev_month = date('F',strtotime('June - 1 month'));
答案 0 :(得分:11)
$next_month = date('F',strtotime('June + 1 month'));
或
$next_month = date('F',strtotime('June next month'));
修改强>
$next_month = date('F',strtotime('June last month'));
答案 1 :(得分:1)
echo date('F',strtotime('June + 1 month'));