I need to compare dates in PHP, in order to check if a contract has expired or not.
For now i'm doing this :
foreach ($this->array as $row)
{
if(strtotime($date1) > strtotime($row['end_date']))
{
$delay = strtotime($row['end_date']);
$expired = "V";
}
else {
$delay = strtotime($row['end_date']);
$expired = "X";
}
So i just know if a contract has expired. I need to write :
echo "The contract will expire in" . $delay;
And the output would be :
The contract will expire in 3 days.
thanks for your help.