php - How to change a color of table data in according to date -


how can change color of table data () in according date ?

e.g have simple calendar created in , each day in other table data () if have 24 january, previous days in table data should have background-color:red; , next days including 24 january should have background-color:grey;

it's possible in php ?

use date('j') figure out current day number , in loop on 24. - 29. row can compare day number current day number , set <td style="background-color: ..."> want. or better attitude make 2 classes, .calendar-day-past , .calendar-day-future, , set background-color property them.


Comments