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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -