use the string formatted time functions (strftime) in the date/time functions section in the manual to convert to Julian date ... which is the current date represented as a value from 1-365, then subtract... this will give you how many days are between the two dates. This DOES NOT account for year change, as it only looks for what day within the year the datestamp is for. So you will want to check for year changes etc.
Also.. I didn't bother to check this code, but should work... I had calender functions burned into my skull while writing an online appointement calender for use by GE last summer.
<?
$date = strftime('%J',$date1)-strftime('%J',$date2);
?>