Home  >  Article  >  Backend Development  >  php returns the current date or the day of the week for the specified date

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

WBOY
WBOYOriginal
2016-07-25 08:44:19839browse
PHP day of the week acquisition code:
  1. date("l"); //Data can get the English day of the week such as Sunday
  2. date("w"); //This can get the numeric day of the week such as 123, note that 0 is Sunday
Copy code
Get the Chinese day of the week:
  1. $weekarray=array("日","一","二","三","四","五","六" ; ","一","二","三","四","五","六");
  2. echo "week".$weekarray[date("w","2011-11-11") ];
Copy code
    php

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