how to find the difference between two dates datetime class in php code example
Example 1: 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 */ }
Example 2: php check if date between two dates
Current date is between two dates