php - Number of days in next month not working -
i'm using below code number of days in next month. displays 31 when there 30 days in november. how solve?
echo date('t',mktime(0,0,0,date("m",strtotime("+1 month")),1,date("y")));
date("m",strtotime("+1 month"))
returns string (nov
), mktime expects arguments integers. means you're getting 0 value injected instead of next month, give number of days in january
date("n",strtotime("+1 month"))
will return month number
Comments
Post a Comment