I'm making a calendar and I need to create a form that repeats a number of times every weekday.
Example:
Today 09/11/2018
I want you to repeat 3 times the day of the week getting like this?
09/11/2018
16/11/2018
23/11/2018
My code is like this, but I'm not getting it, I used it as a repetition structure. How could I do that?
for ($contador = 0; $contador < 3; $contador++) {
$data2 = str_replace("-", "/", date('Y-m-d'));
$data= date('d/m/Y', strtotime($data2));
echo $data."<br>";
$data = DateTime::createFromFormat('d/m/Y', $data);
$data->add(new DateInterval('P7D')); // 7dias
echo $data->format('d/m/Y');
}