Skip to content

Instantly share code, notes, and snippets.

@facumartig
Created July 16, 2013 01:57
Show Gist options
  • Save facumartig/6005194 to your computer and use it in GitHub Desktop.
Save facumartig/6005194 to your computer and use it in GitHub Desktop.
<?php include './functions.php'; if(isset($_GET['source'])) { highlight_file(__FILE__); exit; } ?>
<tr>
<?php
for ($i = 1; $i <= 7; $i++){
if ($i < $primer_dia){
echo "<td><span></span></td>";
}
else {
echo "<td>".$diap."</td>";
$diap++;
}
}
echo "</tr><tr>";
for ($i = 1; $i <= $days_number; $i++) {
echo "<td>".$diap."</td>";
$diap++;
if ($i % 7 == 0){
echo "</tr><tr>";
}
}
// $primer_dia = dia de la semana en el que empieza el mes (1 lunes, 2 martes..)
// $diap = 1 (originalmente)
// $days_number = total de dias del mes (28 febrero, 31 enero..)
?>
</tr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment