Skip to content

Instantly share code, notes, and snippets.

@kureikei
Created Oct 15, 2014
Embed
What would you like to do?
<?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