Php obtains the code for the days of the year. Copy the code as follows: get the number of days of a month, which can be used for any month functiongetDays ($ month, $ year) {switch ($ month) {case4: case6: case9: case11: $ days30; break; case2
The code is as follows:
// Obtain the number of days of a month, which can be used in any month
Function getDays ($ month, $ year)
{
Switch ($ month)
{
Case 4:
Case 6:
Case 9:
Case 11:
$ Days = 30;
Break;
Case 2:
If ($ year % 4 = 0)
{
If ($ year 0 = 0)
{
$ Days = $ year @ 0 = 0? 29: 28;
}
Else
{
$ Days = 29;
}
}
Else
{
$ Days = 28;
}
Break;
Default:
$ Days = 31;
Break;
}
Return $ days;
}
**
* Obtain the day of the week based on the timestamp.
*
* @ Param int $ time_stamp
*/
Function getWeek ($ time_stamp)
{
$ Week_num = date ("w", $ time_stamp );
Switch ($ week_num)
{
Case "0 ":
$ Week = "day ";
Break;
Case '1 ':
$ Week = "1 ";
Break;
Case '2 ':
$ Week = "2 ";
Break;
Case '3 ':
$ Week = "3 ";
Break;
Case '4 ':
$ Week = "4 ";
Break;
Case '5 ':
$ Week = "5 ";
Break;
Case '6 ':
$ Week = "6 ";
Break;
}
Return $ week;
}
The http://www.bkjia.com/PHPjc/320400.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/320400.htmlTechArticle code is as follows: // gets the number of days of a month, which can be used for any month function getDays ($ month, $ year) {switch ($ month) {case 4: case 6: case 9: case 11: $ days = 30; break; case 2...