ouch man you are going about it the hard way....
function datediff($d1, $d2=0)
{
list($month, $day, $year) = explode("-", $d1); //get month-day-year vars
$d1 = mktime(0,0,0, $month, $day, $year); //set d1 from mm-dd-yyyy format to midnite of that day unix timestamp
$d2 = mktime(0,0,0, date("m"), date("d"), date("Y")); //this sets d2 to midnite of today //set d2 to midnite of today
if($d1 < $d2) { $diff = $d2-$d1; } // normal for days in the past
else { $diff = $d1-$d2; } // reverse for days in the future
return $diff/86400; //time between days divided by 1 day (in seconds)
}
note: not tested but looks legit in my head....