- date: documentation ( source)
- strtotime: documentation ( source)
- range: documentation ( source)
- str_pad: documentation ( source)
<?php
$m = 1;
$y = 2016;
foreach (range(1, 31) as $day) {
if($day <= 9){
$day = '0'.$day;
}
echo str_pad(date('l',strtotime("$m/$day/$y")), 9, " ", STR_PAD_LEFT)," $m/$day/$y: ",
date('r',strtotime("monday this week",strtotime("$m/$day/$y"))),"\n";
}