php method to get the day of the week at the current time: first create a PHP sample file; then output the day of the week through the "echo 'Today is the week:'.$array[$s];" statement.
The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer
How does php get the current day of the week?
PHP code for outputting the current date in Chinese format
PHP output code for the day of the week
<?php //飞鸟慕鱼博客 $array = array("日","一","二","三","四","五","六"); $s = date('w'); echo '今天是周:'.$array[$s]; ?>
Code diagram
Code operation results
今天是周:三
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to get the current day of the week in php. For more information, please follow other related articles on the PHP Chinese website!