- date: documentation ( source)
- strtotime: documentation ( source)
<?php
const WEEKDAYS = ['M', 'T', 'W', 'Th', 'F', 'S', 'Su'];
foreach (WEEKDAYS as $weekdayKey => $weekday) {
echo '<div class="form-check form-check-inline">' . PHP_EOL .
' <input class="form-check-input" type="checkbox" id="classDays' . $weekdayKey . '" name="classDays[]" value="' . $weekday . '">' . PHP_EOL .
' <label class="form-check-label" for="classDays[]">' . PHP_EOL .
' ' . date('l', strtotime('2022-01-0' . ($weekdayKey + 3))) . PHP_EOL .
' </label>' . PHP_EOL .
'</div>' . PHP_EOL;
}