KarveR's example prints out the number of days in the current month (at execution time). If you want a different date you also have to pass a second argument that provides the date to be examined. There are many ways to supply that, as a UNIX timestamp, a string transformed into a date with strtotime() etc.
Thanks for the responses KarveR and DRJ478. I regularly use the mktime and date functions but never realised date could tell you how many days in a month :s, I ended up using an array to store days in month hard coded.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.