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'));
$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'));
echo date('F',strtotime('June + 1 month'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With