Cannot use cal_days_in_month as it requires php to be compiled with calendar support