I got an issue on below script, assume $exp_date
is retrieved from db, I want to compare expiry date with today date to check whether membership's is still alive.
There is nothing to display but only Time Expired
, what's wrong with the code?
The data retrieved from expiry column in db is set as varchar (which is built by ex-colleague).
$exp_date = "22/01/2014";
$todays_date = date("d/m/Y");
$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);
echo $expiration_date.' | '.$today.'<br>';
if($expiration_date > $today){
echo 'Still Active';
} else {
echo 'Time Expired';
}
Anyone can help with?