the following code return previous month, it worked fine before.
But today is March 31, the code doesn't work. I guess something to do with 28 days of Feb.
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$month_d=date("n",$lastmonth);
echo $month_d;
how to fix it?