I'm starting my PHP studies, and I have the following challenges: Display Sundays in red and Saturdays in bold. Make the calendar start on a day other than a Sunday. but I have no idea how to do this, could anyone tell me how I do that? What logic to use.
<?php
ini_set("display_errors",1);
ini_set("display_startup_erros",1);
error_reporting(E_ALL);
function linha($semana)
{
echo"<tr>";
for($i = 0; $i<=6;$i++){
if(isset($semana[$i])){
echo "<td>{$semana[$i]}</td>";
}else{
echo "<td></td>";
}
}
echo "</tr>";
}
function Calendario()
{
$dia = 1;
$semana = array();
while($dia <= 31) {
array_push($semana, $dia);
if (count($semana) == 7) {
linha($semana);
$semana = array();
}
$dia++;
}
linha($semana);
}
?>
<table border="1">
<tr>
<th>Dom</th>
<th>Seg</th>
<th>Ter</th>
<th>Qua</th>
<th>Qui</th>
<th>Sex</th>
<th>Sáb</th>
</tr>
<?php calendario();?>
</table>