Answers for "compare date if month match in php"

PHP
7

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
0

php check if date is older than 1 month

if(strtotime('2011-08-19 17:14:40') < strtotime('-30 days')) {
     // this is true
 }
Posted by: Guest on August-10-2021

Browse Popular Code Answers by Language