PHP Date Time: Finding The Number of Days in a Month
PHP Date Time Tips - Part 7: Do you want to find the number of days in a particular month? You can use date function with the "t" modifier. like this:
<?php
// find for 8 august 2008
// get timestamp for month and year august 2008
$tm = mktime(0,0,0,8,8,2008);
// find number of days in august 2008
echo date("t", $tm);
?>