Check out the PHP function strtotime. Here is a quick sample of how you could use it.
[PHP]$exp_date = "2006-01-16";
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);
if ($expiration_date > $today)
{
$valid = "yes";
}
else
{
$valid = "no";
}[/PHP]
To evaluate the validity using e.g. 5 days:
[PHP]
$reg_date = "2008-02-08";//can be dynamically obtained by inserting NOW() into a database table field of the time DATE or DATETIME
$todays_date = date("Y-m-d");
$today = strtotime($todays_date)/3600*24;
$start_date = strtotime($reg_date)/3600*24;
if ($today - $start_date >= 5)
{
$expired= "yes";
}
else
{
$expired= "no";
}[/PHP]