Receive a month after and before a month

How to get the name of the month after a certain month. So in June I would like July

I tried:

$next_month = date('F',strtotime('June', "next month"));

This January display, which is obviously erroneous, I'm looking for July.

How could I get a month earlier?

I tried

$prev_month = date('F',strtotime('June - 1 month'));
+3
source share
2 answers
$next_month = date('F',strtotime('June + 1 month'));

or

$next_month = date('F',strtotime('June next month'));

change

$next_month = date('F',strtotime('June last month'));
+10
source
echo date('F',strtotime('June + 1 month'));
+1
source

All Articles