vendredi 10 septembre 2021

Date Compare - HTML table cell background color if condition

I have a simple question But im totally lost. I have a table, data comes from mysql with php.

<td><?php echo date('d-m-Y', strtotime($row["date1"])) ?></td> 
<td><?php echo date('d-m-Y', strtotime($row["date2"])) ?></td> 
<td><?php echo date('d-m-Y', strtotime($row["date3"])) ?></td> 
<td><?php echo date('d-m-Y', strtotime($row["date4"])) ?></td>

ex: if date1 has 10 days left cell background red. ex2: if date2 has 10 days left cell background red. I think i need loop. Anyone help ? Thank you!

Aucun commentaire:

Enregistrer un commentaire