Ho do i find out which month has how many days with PHP? Ok July is 31 days but, how can i calculate it?
Take a look at the date() function in the PHP Manual ( found at http://au.php.net/manual/en/function.date.php ). There is a special format, t, that returns the number of days in a given month. For example, to find the number of days in July, you could write something like:
$julyDays = date('t', mktime(0, 0, 0, 7, 1, 2008));
since the mktime() function makes a time for the supplied hour, minute, second, month, day and year.
Hope this helps :)
Thanks darkagn. This is what i wanted.