Simple Function to calculate no. of days between two dates
by Guna[ Edit ] 2011-03-11 16:38:51
Hi,
This function calculates days count between two given dates. check it out
function dateDiff($start, $end) {
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
}
//echo dateDiff("2008-03-29", "2008-03-30") ."
";
//echo dateDiff("2008-03-29", "2008-03-31") . "
";