Skip to content

Instantly share code, notes, and snippets.

@andimariadi
Created March 31, 2018 23:55
Show Gist options
  • Save andimariadi/99e7d618f55a7449e1d1d322b5c8d980 to your computer and use it in GitHub Desktop.
Save andimariadi/99e7d618f55a7449e1d1d322b5c8d980 to your computer and use it in GitHub Desktop.
Script coding table
<?php
$d = date('d');
if ($d <= 9) {
$d = str_replace('0', '', $d);
}
$date = new DateTime('now');
$dd = $date->modify('last day of this month');
$last = $dd->format('d');
echo '<table border="1">';
echo '<tr>';
for ($a=$d,$i = 1; $i <= 15; $a++,$i++) {
if ($a > $last) {
$a = 1;
$month = date('d-m-Y', strtotime('+1 month'));
} else {
$month = date('d-m-Y');
}
echo '<td>' . $a;
echo '<tr>';
for ($z=0; $z < 24; $z++) {
echo '<td>' . $z . '</td>';
}
echo '</tr></td>';
}
echo '</tr>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment