Home  >  Article  >  php教程  >  php返回当前日期或者指定日期是周几,php当前

php返回当前日期或者指定日期是周几,php当前

WBOY
WBOYOriginal
2016-06-13 09:03:50979browse

php返回当前日期或者指定日期是周几,php当前

PHP星期几获取代码:

复制代码 代码如下:
date("l"); //data就可以获取英文的星期比如Sunday
date("w"); //这个可以获取数字星期比如123,注意0是星期日

获取中文星期几:

复制代码 代码如下:
$weekarray=array("日","一","二","三","四","五","六"); //先定义一个数组
echo "星期".$weekarray[date("w")];

获取指定日期是:

复制代码 代码如下:
$weekarray=array("日","一","二","三","四","五","六");
echo "星期".$weekarray[date("w","2011-11-11")];

以上所述就是本文赌钱不内容了,希望大家能够喜欢。

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