just do something like this
(assuming you are using timestamps)
function days_between($date_from, $date_to)
{
$d1 = $mktime(0,0,0,date("m",$date_from),date("j",$date_from),date("Y",$date_from)); //midnite of date_from
$d2 = $mktime(0,0,0,date("m",$date_to),date("j",$date_to),date("Y",$date_to)); //midnite of date_to
return ($d2 - $d1) / 86400; //difference in seconds between days divided by 86400 (seconds in day) gives you difference in days
}