PHP - 比较两个日期[重复]

This question already has an answer here:

I want check whether the date from variable is older than current date about 7 days or more.

Now, I check whether this date is -1 day from current:

   $old_email = strtotime($result->repairs_date_received) >= strtotime('-1 day') ? true : false;
</div>

UNIX time is in seconds, so you can simply check using basic operators like > and <.

$week_ago = strtotime('a week ago');
$check = strtotime($result->repairs_date_received);

if($check > $week_ago){
    // date is newer than week 
} else {
    // date is older than week
}