<?php
$data_inicio = new DateTime('2017-01-02');
$data_fim = new DateTime('2017-01-09');
$interval = new DateInterval("P1D");
for ($i = $data_inicio; $i <= $data_fim; $i->add($interval))
{
echo $i->format("Y-m-d") . PHP_EOL;
}
PD9waHAKCiRkYXRhX2luaWNpbyA9IG5ldyBEYXRlVGltZSgnMjAxNy0wMS0wMicpOyAKJGRhdGFfZmltID0gbmV3IERhdGVUaW1lKCcyMDE3LTAxLTA5Jyk7CgokaW50ZXJ2YWwgPSBuZXcgRGF0ZUludGVydmFsKCJQMUQiKTsKCmZvciAoJGkgPSAkZGF0YV9pbmljaW87ICRpIDw9ICRkYXRhX2ZpbTsgJGktPmFkZCgkaW50ZXJ2YWwpKQp7CiAgZWNobyAkaS0+Zm9ybWF0KCJZLW0tZCIpIC4gUEhQX0VPTDsKfQ==