I have a loop and within a loop there are quoted just two options: $variable = $index === 0 ? 'Today' : 'Tomorrow'; As I have 10 days forecast, how to modify a line within loop to 8 or 10 days? Today Tomorrow Thursday Friday Saturday etc.
No5needinput
3:06 pm on Jan 20, 2026 (gmt 0)
ChatGPT suggestion...
$dayLabels = ['Today', 'Tomorrow'];
for ($index = 0; $index < 10; $index++) { if ($index >= 2) { $dayLabels[$index] = date('l', strtotime("+$index days")); }