1. convert each time to a unix timestamp
2. calculate the difference
3. divide by number of seconds in a day (86,400)
4. round down to nearest integer
<?php
$stamp1 = strtotime($date1);
$stamp2 = strtotime($date2);
$deltaSeconds = abs($stamp2 - $stamp1);
$deltaDays = floor( $deltaSeconds / (60 * 60 * 24) );
printf("%d days<br>", $deltaDays);
?>