PHP provides us with a large number of functions to get the day of the week, we commonly use the date () function, let me introduce the date of the week to get a specific instance.
PHP date () parameter description
Here the main use of the W this
Php obtains the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week.
$ Today = date ("Y-m-d ");
Echo $ today; // you can get the number of today. Output
// Define an array first.
$
PHP retrieves the first and last days of the week. // The first and last days of the week. $ date = new & nbsp; DateTime (); $ date-& gt; modify ('This & nbsp; week '); $ first_day_of_week = $ date-& gt; format ('Y-m-D'); $ date-& gt; modify PHP get
Php gets the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week. Php returns the day of a day, the day of a week, and the date $ todaydate (Y-m-d) corresponding to Monday and next Monday.
PHP gets the first and last day of the week
The first and last day of the week$date =new DateTime ();$date->modify (' this week ');$first _day_of_week= $date->format (' y-m-d ');$date->modify (' This week +6 days ');$end _day_of_week= $date->format
Php returns the current date or the specified date is the day of the week. Php returns the current date or the specified date is the day of the week. php obtains the code for the current PHP day of the week: Copy the code as follows: date (l ); for
PHP to obtain the day of the Week program. In php, we want to obtain the day of the week, which can be operated by using the date function. next I will summarize the specific operation methods for you, I hope this method will be helpful to all of
PHP implementation of the method based on timestamps to get weeks, PHP stamp gets weeks
The examples in this article describe how PHP implements the week-by-time timestamp. Share to everyone for your reference, as follows:
Gets the number of weeks
PHP Week Get Code:
Date ("L"); Data can be obtained in English for weeks such as Sunday
Date ("W"); This can get the numbers for weeks like 123, note that 0 is Sunday
Get Chinese Weekday:
$weekarray =array ("Day", "one", "two", "three", "four",
PHP Week to get code:Date ("L"); Data will be available for English week like SundayDate ("W"); This can get a digital week like 123, note 0 is Sunday
Get Chinese day of the week:$weekarray =array ("Day", "one", "two", "three", "four", "five", "six")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.