Calculate the number of days between two dates using PHP:
// Function
function daysBetween2Dates($start, $end)
{
$day = 86400; // Day in seconds
$sTime = strtotime($start); // Start as time
$eTime = strtotime($end); // End as time
return round(($eTime - $sTime) / $day) + 1;
}
$start = "2011-03-5";
$end = "2011-03-15";
print daysBetween2Dates($start, $end);
That's it!