In base al suggerimento di Alhazred si potrebbe fare cosi (non è il massimo ma funziona):
codice:
function myTab()
{
echo str_repeat(' ', 3);
}
function templateDay($start, $end)
{
$dayOfWeek = ['LUNEDI', 'MARTEDI', 'MERCOLEDI', 'GIOVEDI', 'VENERDI', 'SABATO', 'DOMENICA'];
$dayOfWeekLink = ['/1.html', '/2.html', '/3.html', '/4.html', '/5.html', '/6.html', '/7.html'];
$toDay = date('N') - 1;
for ($i = $start; $i < $end; $i++) {
echo $dayOfWeek[$toDay] === $dayOfWeek[$i] ? "<a href='$dayOfWeekLink[$i]' style='color:red'>" . 'OGGI' . '</a>' . myTab() : "<a href='$dayOfWeekLink[$i]'>" . $dayOfWeek[$i] . '</a>' . myTab();
}
}
templateDay(3, 7);
templateDay(0, 3);