Generating the days in a week
<?php
$now = time();
if (3 < strftime('%H', $now)) { $now += 7200; }
$today = strftime('%w', $now);
$start_day = $now - (86400 * $today);
for ($i = 0; $i < 7; $i++) {
print strftime('%c',$start_day + 86400 * $i);
}
?>
Related examples in the same category