Home >Backend Development >PHP Problem >How to determine if the timestamp is today in php
php determines whether the timestamp is today's implementation method: first create a PHP sample file; then obtain the timestamp through the time function; then pass "if(date('Ymd', $timestamp) == date( 'Ymd')) {}" method can be used to determine whether the timestamp is today.
Recommendation: "PHP Video Tutorial"
php determines whether it is like today
<?php $timestamp = time(); // 时间戳 if(date('Ymd', $timestamp) == date('Ymd')) { echo '今天'; }
Yes, as long as you judge the day after the month, you can know whether it has already happened once today, or whether it is today.
The above is the detailed content of How to determine if the timestamp is today in php. For more information, please follow other related articles on the PHP Chinese website!