Php returns the current date or the specified date is the day of the week. Php returns the current date or specifies the date of the week. This article will share with you the formatting methods of several date functions, which is very simple and practical. if you need it, you can refer to it. P 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.
In this article, we will share with you the formatting methods of several date functions, which are very simple and practical. if you need them, you can refer to them. P...