I'm trying to build an array of days using date(z) days of year format, starting with today, and stepping through a set number of days.
I've figured out a solution to this, but it doesn't feel like it's the most efficient, maybe there is a built-in function in PHP for this.
Current solution:
$today = date(z);
$count = 3;
$array = array();
$i = 0;
while ($i < $count) {
$array[] = $today + $i;
$i++;
}
print_r($array);
Outputs correctly to this: Array ( [0] => 297 [1] => 298 [2] => 299 )
Any other better solutions?
forloop would be better than thewhile.$countis high enough to cross years?