In PHP, if we want to get the day of the week today, we can directly use the date function to operate it. Let me summarize the specific operation method for you. I hope this method will be helpful to all my friends.
A brief introduction to how to get the day of the week in PHP, and the code to get the day of the week in PHP:
The code is as follows
|
Copy code
|
||||||||||||||||
2 //data can get the English day of the week such as Sunday
3 date(“w”);
|
The code is as follows | Copy code | ||||||||||||
1 $weekarray=array("日", "一", "二", "三", "四", "五", "六");
2 //Define an array first
3 echo “week”.$weekarray[date(“w”)];
Get the specified date:
source:php.cn
Previous article:PHP cookie usage methods and precautions_PHP tutorial
Next article:Several methods of PHP page jump code_PHP tutorial
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
Latest Articles by Author
Latest Issues
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|