问题
How do I get the month name after a given month. So for June, I would want July
I have tried:
$next_month = date('F',strtotime('June', "next month"));
This display January, which is obviously wrong, I am looking for July.
How would I then get the month before?
I have tried
$prev_month = date('F',strtotime('June - 1 month'));
回答1:
$next_month = date('F',strtotime('June + 1 month'));
or
$next_month = date('F',strtotime('June next month'));
edit
$next_month = date('F',strtotime('June last month'));
回答2:
echo date('F',strtotime('June + 1 month'));
来源:https://stackoverflow.com/questions/10514291/get-month-after-and-before-given-month-name