PHP obtains the maximum number of days (the last day) of a month. PHP obtains the maximum number of days of a month (the last day). the last day of the number of days this article describes how PHP obtains the maximum number of days of a month (the last day. Share with you how PHP can obtain the maximum number of days of a month (the last day ).
This example describes how to obtain the maximum number of days of a month (the last day) by PHP. Share it with you for your reference. The details are as follows:
// Obtain the maximum number of days of a month (the last day) function getMonthLastDay ($ month, $ year) {switch ($ month) {case 4: case 6: case 9: case 11: $ days = 30; break; case 2: if ($ year % 4 = 0) {if ($ year % 100 = 0) {$ days = $ year % 400 = 0? 29: 28;} else {$ days = 29;} else {$ days = 28;} break; default: $ days = 31; break;} return $ days ;}
I hope this article will help you with php programming.
The last day. This document describes how PHP obtains the maximum number of days (the last day) of a month. Share it with you...