And if you use it in conjunction with
<?php
date("t",$month);
?>
then you can do this:
<?php
$number_of_days = date("t",$month); // where $month is the number of the month
$day = mktime(0,0,0,$number_of_days);
echo $day;
?>
where $month is dynamically generated however you choose.
(or something like that, I haven't tested it, so I dunno if it works exactly as above)