Tuesday, December 22, 2009

Check if a date is in the past

$diff = (number_format((time() - strtotime($date_to_check)) / (60 * 60 * 24), 2));

if ($diff > 0)
{
echo "$date is $diff days ago from today";
}

No comments:

Post a Comment