Home > Backend Development > PHP Problem > How to get today's date in php

How to get today's date in php

藏色散人
Release: 2023-03-14 07:04:02
Original
2574 people have browsed it

php method to get what day it is today: 1. Create a PHP sample file; 2. Get what day it is through the "echo date('d')" method.

How to get today's date in php

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3.

How to get what day is today in php?

php gets the day of the day and the day of the week

The code is as follows:

echo date(&#39;y&#39;).&#39;</br>&#39;;    //当前年份
echo date(&#39;m&#39;).&#39;</br>&#39;;    //当前月份
echo date(&#39;d&#39;).&#39;</br>&#39;;    //当前日
echo date(&#39;s&#39;).&#39;</br>&#39;;    //当前秒
echo date(&#39;w&#39;).&#39;</br>&#39;;    //当前周几
Copy after login

Print as follows

How to get todays date in php

Recommended learning: "PHP video tutorial"

The above is the detailed content of How to get today's date 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