Home > Backend Development > PHP Tutorial > PHP returns the current date or the day of the week when the specified date is, PHP current_PHP tutorial

PHP returns the current date or the day of the week when the specified date is, PHP current_PHP tutorial

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

php returns the current date or the day of the week for the specified date, php currently

PHP day of the week get code:

Copy 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:

Copy code The code is as follows:
$weekarray=array("日","一","二","三","四","五","六"); //First define an array
echo "week".$weekarray[date("w")];

Get the specified date:

Copy code 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/1003993.htmlTechArticlephp returns the current date or the day of the week of the specified date, php current PHP day of the week gets the code: Copy the code code as follows: date("l"); //data can get the English day of the week such as Sunday date...
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