I have the following code. It works to add days (daysBetween) to a date (startDate). However, I want to REPEAT it until it reaches the end date. How can I do this??
$startDate = "2009-10-11";
$endDate = "2010-01-20";
$daysBetween = 10;
function addDayswithdate($date,$days){
$date = strtotime("+".$days." days", strtotime($date));
return date("Y-m-d", $date);
}
$date = addDayswithdate($startDate,$daysBetween);