How to get the current day of the week in php

藏色散人
Release: 2023-03-11 15:14:02
Original
4176 people have browsed it

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.

How to get the current day of the week in php

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(&#39;w&#39;);
echo &#39;今天是周:&#39;.$array[$s];
?>
Copy after login

Code diagram

How to get the current day of the week in php

Code operation results

今天是周:三
Copy after login

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!

Related labels:
php
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