<?php
function dateDiff($start, $end) {
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
}
echo dateDiff("2006-04-05", "2006-04-01");
?>
if you want to see all dates between today and the next 20 days you need to use something like this
$startDate = date("Y-m-d", mktime(0, 0, 0, 2, 23, 2008));
$endDate = date("Y-m-d", mktime(0, 0, 0, 2, 23+20, 2008));
$i=0;
while ($temp <> $endDate) {
echo $temp = date("Y-m-d", mktime(0, 0, 0, 2, 23+$i, 2008));
$i++;
};