Page 1 of 1

About calculating number of days in a month

Posted: Sat Nov 29, 2003 4:18 pm
by bckennyw
The hosting service I have did not compile PHP with "--enable-calendar". It seems that I am not able to call the functions associated with calendar.

Is there anyway I can still get the number of days in a month?

Thanks!!!!!

Posted: Sat Nov 29, 2003 4:24 pm
by mchaggis
Yes, you can try doing it the old fashioned way ;)

Code: Select all

<?php
function daysinmonth ($month) {
    return date('j', mktime(0,0,0,($month+1),0,2003));
}
?>