I know about the unwanted behaviour of PHP\'s function
strtotime
For example, when adding a month (+1
Here's the algorithm you can use. It should be simple enough to implement yourself.
t
in date()
to get the last day: date( 't.m.Y' )
function ldom($m,$y){
//return tha last date of a given month based on the month and the year
//(factors in leap years)
$first_day= strtotime (date($m.'/1/'.$y));
$next_month = date('m',strtotime ( '+32 day' , $first_day)) ;
$last_day= strtotime ( '-1 day' , strtotime (date($next_month.'/1/'.$y)) ) ;
return $last_day;
}