Simple perpetual calendar function. A perpetual calendar function was required a few days ago. I saw a perpetual calendar on oso. The program function was powerful, but it was too cumbersome. I did not meet my own requirements, so I wrote one myself. I can also // a perpetual calendar function was required a few days ago. I saw a perpetual calendar on oso. The program function was powerful, but it was too cumbersome.
// Because it does not meet your own requirements, you can write one yourself and add a connection to the date!
Function calendar ($ year, $ moon ){
$ Moon1 = array ("01", "02", "03", "04", "05", "06", "07", "08 ", "09", "10", "11", "12 ");
$ Moon2 = array ("31", "28", "31", "30", "31", "30", "31", "31 ", "30", "31", "30", "31 ");
If ($ year-2000) % 4 = 0) {$ moon2 [1] = 29 ;}
For ($ I = 0; $ I <= 11; $ I ++ ){
If ($ moon1 [$ I] ==$ moon ){
$ Total = $ moon2 [$ I];
}
}
$ Out_chat = "";
$ Out_chat. = "May 15, 1234 ";
For ($ I = 1; $ I <= $ total; $ I ++ ){
$ J = $ I;
If ($ I <10 ){
$ J = "0". $ I;
}
$ Time_array = getdate (mktime (0, 0, 0, $ moon, $ j, $ year ));
If ($ I = 1 ){
Switch ($ time_array [wday]) {
Case "0 ":
$ Out_chat. = "". $ I ."";
Break;
Case "1 ":
$ Out_chat. = "". $ I ."";
Break;
Case "2 ":
$ Out_chat. = "". $ I ."";
Break;
Case "3 ":
$ Out_chat. = "". $ I ."";
Break;
Case "4 ":
$ Out_chat. = "". $ I ."";
Break;
Case "5 ":
$ Out_chat. = "". $ I ."";
Break;
Case "6 ":
$ Out_chat. = "". $ I ."";
Break;
}
} Else {
If ($ I! = $ Total ){
If ($ time_array [wday]! = 0 ){
$ Out_chat. = "". $ I ."";
} Else {
$ Out_chat. = "". $ I ."";
}
} Elseif ($ I ==$ total ){
Switch ($ time_array [wday]) {
Case "0 ":
$ Out_chat. = "". $ I ."";
Break;
Case "1 ":
$ Out_chat. = "". $ I ."";
Break;
Case "2 ":
$ Out_chat. = "". $ I ."";
Break;
Case "3 ":
$ Out_chat. = "". $ I ."";
Break;
Case "4 ":
$ Out_chat. = "". $ I ."";
Break;
Case "5 ":
$ Out_chat. = "". $ I ."";
Break;
Case "6 ":
$ Out_chat. = "". $ I ."";
Break;
}
}
}
}
$ Out_chat. = "";
Return $ out_chat;
}
$ Year = 2000;
$ Moon = 08;
$ Test = calendar ($ year, $ moon );
Echo $ test;
?>
Bytes. // It does not meet your requirements. Therefore, you can write one by yourself...