Tuesday, December 29, 2009

PHP: How get the number of days in month

Easiest way to get number of days in month are to use date function.

echo date("t",mktime(0,0,0,$month,1,$year);

Also this will work with leap year.

No comments:

Post a Comment

 
Software