Home > Backend Development > PHP Tutorial > PHP returns the current date or the day of the week for a specified date_PHP Tutorial

PHP returns the current date or the day of the week for a specified date_PHP Tutorial

WBOY
Release: 2016-07-13 09:53:13
Original
1130 people have browsed it

php returns the current date or the day of the week that the specified date is

This article will share with you the formatting methods of several date functions. It is very simple and practical. Friends in need You can refer to it.

PHP day of the week code:

The code is as follows:

Date("l"); //data can get the English day of the week such as Sunday

Date("w"); //This can get the numerical day of the week, such as 123. Note that 0 is Sunday

Get the Chinese day of the week:

The code is as follows:

$weekarray=array("日","一","二","三","四","五","六"); //First define an array

echo "week".$weekarray[date("w")];

Obtain the specified date:

The code is as follows:

$weekarray=array("日","一","二","三","四","五","六");

echo "week".$weekarray[date("w","2011-11-11")];

The above is the content of this article about gambling. I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1003829.htmlTechArticlephp returns the current date or the day of the week the specified date is. This article shares with you the formatting methods of several date functions. , very simple and practical, friends in need can refer to it. P...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template