-2
<?php
function linha($semana){
echo "<tr>";
for ($i=0; $i<=6; $i++):
if(isset($semana[$i])):
echo "<td>$semana[$i]</td>";
else:
echo "<td> </td>";
endif;
endfor;
echo "</tr>";
}
function calendario(){
$dia = 1;
$semana = array();
while ($dia <= 31):
array_push($semana,$dia);
if(count($semana)== 7) :
linha($semana);
$semana = array();
endif;
$dia++;
endwhile;
linha($semana);
}
?>
<table border="1">
<tr>
<th>Dom</th>
<th>Seg</th>
<th>Ter</th>
<th>Qua</th>
<th>Quin</th>
<th>Sex</th>
<th>Sáb</th>
</tr>
<?php calendario() ?>
</table>
You wait until Monday and start using it, there will be no mistake. joke. details more your problem.
– Marco Souza
kkkk, like my day 1 only starts Sunday, and I want to change so that Day 1 is another day of the week without being Sunday...
– Jeyziel Gama