cleaning up, weeknumber in php…

on

<?php

setlocale(LC_ALL, ‘nl_NL’);

$weeknrkeep=-1;

$today = time();
echo $today.”<br>”;

for ($i=0;$i<200;$i++) :
$weeknr= strftime(‘%V’, strtotime(‘+’.$i.’ day’,$today));

if ($weeknr != $weeknrkeep):
echo “<br><strong>week “.$weeknr.”</strong><br>”;
endif;

echo strftime(‘%a %d-%m-%Y’, strtotime(‘+’.$i.’ day’,$today)).”<br>\n\r”;

$weeknrkeep=$weeknr;

endfor;

?>

this outputs a list of weeknumbers and the days’s and dates in that week. must have been some test for some website…..

output looks like:

week 14
vr 03-04-2015
za 04-04-2015
zo 05-04-2015

week 15
ma 06-04-2015
di 07-04-2015
wo 08-04-2015
do 09-04-2015
vr 10-04-2015
za 11-04-2015
zo 12-04-2015

week 16
ma 13-04-2015
di 14-04-2015
wo 15-04-2015
do 16-04-2015
vr 17-04-2015
za 18-04-2015
zo 19-04-2015

…..etc etc