I would like to insert the date on it to add + 1 day and insert again.
I have this script but it returns me random date:
date_default_timezone_set("Brazil/East");
$data = '2017-01-02';
$data_fim='2017-01-09';
echo '<br />';
//faz a repeticao
for($i = 0; $i < $data_fim; $i++)
{
// Soma 1 DIA
echo $data = date('Y-m-d', strtotime($i . " days", strtotime($data)));
echo '<br />';
}
echo '<br />';
type like this:
2017-01-02
2017-01-03
2017-01-05
2017-01-08
2017-01-12
2017-01-17
2017-01-23
2017-01-30
2017-02-07
2017-02-16
2017-02-26
2017-03-09
2017-03-21
2017-04-03
2017-04-17
2017-05-02
2017-05-18
2017-06-04
2017-06-22
2017-07-11
2017-07-31
2017-08-21
Can anyone tell me what I'm doing wrong?