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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -