Php returns the current date or the specified date is the day of the week
This article will share with you the formatting methods of several date functions, which are very simple and practical. For more information, see.
PHP day of the week to get the code:
The Code is as follows:
Date ("l"); // data can be used to obtain the week in English, such as Sunday.
Date ("w"); // you can obtain the number of weeks, for example, 123. Note that 0 is Sunday.
Get Chinese day of the week:
The Code is as follows:
$ Weekarray = array ("day", "one", "two", "three", "four", "five", "Six"); // define an array first
Echo "Week". $ weekarray [date ("w")];
Obtain the specified date:
The Code is as follows:
$ Weekarray = array ("day", "one", "two", "three", "four", "five", "Six ");
Echo "Week". $ weekarray [date ("w", "2011-11-11")];
I hope you will like the above.