D
D
Dmitry Kamyannoy2015-05-05 09:56:23
PHP
Dmitry Kamyannoy, 2015-05-05 09:56:23

How to get next month from current month?

Good afternoon. I ask for help in deriving the next month from the current one, and one more.
That is, let's say we mean the standard function

date ("m");
// Грубо говоря, это текущий месяц, а как можно вывести следующий, имея только текущий? 
// Ну код не верный, но, думаю, многие поймут о  чем я
date("m", +1); //Июнь 
date("m", +2); //Июль

Thank you very much.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Komarov, 2015-05-05
@redfieldone

$date = new \DateTime('now');
echo $date->modify('+1 month')->format('M');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question