What is best solution to get next and previous month from given date php -
What is best solution to get next and previous month from given date php -
i want next , previous month given date. code.
$month = '2011-01-20';
$prevmonth = funp($month); $nextmonth = funn($month);
what best solution that.
$next_month_ts = strtotime('2011-01-20 +1 month'); $prev_month_ts = strtotime('2011-01-20 -1 month'); $next_month = date('y-m-d', $next_month_ts); $prev_month = date('y-m-d', $prev_month_ts);
php
Comments
Post a Comment