Code: Select all
<?php
$day = date("d"); //today
$month = date("M"); //this month
$year = date("Y"); //this year
$cycle = "1"; //number of months
$lastday = mktime(0, 0, 0, $month, 0, $year);
$days = strftime("%d", $lastday); //days in this month
$nextMonth = time() + ($cycle * $days * 24 * 60 * 60);
// number of months * days in this month * 24 hours a day * 60 minutes per hour * 60 seconds per minute
echo 'Next Month\'s date is: '. date('Y-m-d', $nextMonth) ."\n";
?>