Forum Moderators: coopster

Message Too Old, No Replies

Using date() to find out days of a given month

         

DaSingh

10:51 am on May 20, 2005 (gmt 0)

10+ Year Member



Is it possible to use the php date function to find the number of days in given month.

I know that date("d") gives the current date, but I have the month as a number and want to use this to find out the days in that month

Thanks

Parm

dreamcatcher

12:41 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use this function:

http://docs.php.net/en/function.cal-days-in-month.html [docs.php.net]

dc

DaSingh

12:43 pm on May 20, 2005 (gmt 0)

10+ Year Member



Nice one, thanks for that!

Parm

ergophobe

8:36 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can also use the %t flag in the date function