PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $year = 2022; $month = 7; for($d=1; $d<31; $d++) { $day_of_week = date('N', strtotime(sprintf("%d-%02d-%02d", $year, $month, $d))); if ($d == 1) echo str_pad('', ($day_of_week - 1) * 3); printf("% 3d", $d); echo ($day_of_week == 7 ? PHP_EOL : ''); }
Show:  
Copy Clear