Answers for "php compare date less than 1 year"

PHP
18

php compare two dates

$today = date("Y-m-d");
$expire = $row->expireDate; //from database

$today_time = strtotime($today);
$expire_time = strtotime($expire);

if ($expire_time < $today_time) { /* do Something */ }
Posted by: Guest on December-15-2019
3

how to get the difference of multiple dates in php

## CAN GET THE DIFFERENCE DATE BY DAY USING [PHP STRTOTIME FUNCTION]
echo (strtotime(date("2022-03-03")) - strtotime(date("2022-04-03"))) /60/60/24;
Posted by: Guest on April-06-2022

Browse Popular Code Answers by Language