Skip to content

Instantly share code, notes, and snippets.

@kureikei
Created October 15, 2014 10:34
Show Gist options
  • Save kureikei/50160f96a6983e218ed8 to your computer and use it in GitHub Desktop.
Save kureikei/50160f96a6983e218ed8 to your computer and use it in GitHub Desktop.
<?php
echo str_repeat("\t", $fwday = date("w", mktime(0, 0, 0, date('n'), 1, date('Y'))));
for ($day = 1; checkdate(date('n'), $day, date('Y')); $day++)
echo ($day < 10 ? " " : "") . $day. (($day + $fwday) % 7 == 0 ? "\n" : "\t");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment