Here is how you get the number of days between two dates.
function getdays($day1,$day2) { return round((strtotime($day2)-strtotime($day1))/(24*60*60),0); } $begin = date("Y-m-d"); // we set today as an example $end = "2007-01-29"; echo getdays($begin,$end).' days'; |
This was taken from the manual – posted by: michiel at mb-it dot nl