Code: Select all
$subs1 = new DateTime($row->datereg);
$subs = new DateTime($row->datereg);
$subs->modify('+30days');
$date = strtotime("$row->datereg");
$add30 = date('Y-m-d', strtotime("+30 days", $date));
$remaining = ($add30 - $row->datereg);
if ($subs1 <= $subs)
{ echo " | <span style='background-color: #00cc00; padding: 2px; color: #ffffff'>TRIAL USED $remaining $add30</span>";}
}
I'm making a real pigs-ear of this.
I need to see if they are within their trial period.
But also (and this is the bit I cannot make work), display how many days they have left.
I have converted it to a strtotime to them see if one is less than the other, but how to do work out the days between the their final day, and today? I've just noticed I don't have "today" in the calculation, but I still don't know how to convert the result into a number of day.
Thanks.