PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $year = 2022; $month = 8; $days_in_month = date('j', mktime(0, 0, 0, $month+1, 0, $year)); echo " пн вт ср чт пт сб вс" . PHP_EOL; for($d=1; $d<=$days_in_month; $d++) { $day_of_week = date('N', mktime(0, 0, 0, $month, $d, $year)); if ($d == 1) echo str_pad('', ($day_of_week - 1) * 3); printf("% 3d", $d); echo ($day_of_week == 7 ? PHP_EOL : ''); }
Show:  
Copy Clear