As a programmer, there are no real problems but challenges...ones that we need to overcome. This means that there is a solution for all challenges that one may face. For all the challenges that I have faced, I will share them and their solutions.
Monday, September 7, 2009
php number of days in month
in my search for a method to get the number of days in a given month in php, i found one method from the php.net site. it uses the t variable in the date function. i tested it and it returned 31 days for the month of september. i found another method at the about.com site. i like it. this is how it works: $noOfDaysInMonth = cal_days_in_month(CAL_GREGORIAN, $monthIndex, $year) ; it takes the month index and the year and returns the number of days in that month.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment