to get next month it should be as simple as:
date("n", mktime(0, 0, 0, $month + 1));
according to one of the comments in mktime, an incorrect month returns if the month you’re trying to get has less number of days than the current month.
to fix,…
more »