Number of days of the week in a loop (the red letter shows the number of days of the current week) $ week_array = array (1, 2, 4, 5, 6, 7); foreach ($ week_arrayAS $ key = $ value) {if ($ value = date (w) $ value = fontcolor = red. $ valu
Number of days of the week in a loop (the red letter shows the number of days of the week)
$ Week_array = array (1, 2, 3, 4, 5, 6, 7 );
Foreach ($ week_array AS $ key => $ value)
{
If ($ value = date ("w "))
$ Value = "". $ value ."";
Echo $ value ."";
}
The number of days in the current month is output cyclically (the red letter shows the current number)
For ($ day = date ("t"); $ day> 0; $ day --)
$ Month_array [] = $ day;
Sort ($ month_array );
Foreach ($ month_array AS $ key => $ value)
{
If ($ value = date ("j "))
$ Value = "". $ value ."";
Echo $ value ."";
} Echo 'month of the current year :';
For ($ I = 1; $ I <= 12; $ I ++ ){
If ($ I = date ('N') echo'';
Echo "$ I \ t ";
If ($ I = date ('N') echo'';
}
Echo"
\ N number of days in the current month :";
For ($ I = 1; $ I <= date ('t'); $ I ++ ){
If ($ I = date ('J') echo'';
Echo "$ I \ t ";
If ($ I = date ('J') echo'';
}
Echo"
\ N days of the week :";
$ Arr = array ('day', 'yi', '2', '3', '4', '5', '6 ');
For ($ I = 0; $ I <6; $ I ++ ){
If ($ I = date ('w') echo'';
Echo $ arr [$ I]. "\ t ";
If ($ I = date ('w') echo'';
}
Echo"
\ N hour of the current day :";
For ($ I = 0; $ I <24; ++ $ I ){
If ($ I = date ('g') echo'';
Echo "$ I \ t ";
If ($ I = date ('g') echo'';
}