So I have the following for loop:
$arr = [];
for($x = date('j', strtotime('this week')); $x <= date('j', strtotime('this week + 6 days')); $x++)
{
dd('test');
$arr[$x] = [
'y' => $x,
's' => 0,
'c' => 0,
'cl' => 0
];
}
dd('test2');
The problem is that the loop is never accessed...the dd() returns 'test2' but the for loop is not accessed and it doesn't return any errors. I have a similar one:
for($x = 1; $x <= date('t', strtotime('today')); $x++)
{
$arr[$x] = [
'y' => $x . ' ' . date('M', strtotime('today')),
's' => 0,
'c' => 0,
'cl' => 0
];
}
And this one works perfectly. What I am trying to do is generate indexes for $arr based on this week's days or in the following case based on this month's days. I simply don't understand why one works and the other doesn't. Thank you all for your time and help!