Forum Moderators: coopster
<?php
for($i=1; $i<=52; $i++){
echo date("M d Y", strtotime('+'.$i.' Monday')).'<br>';
}
?>
venelin13 your code isn't what I need, it prints the following 12 months only the day stays the same as the current day eg jan 14 feb 14 mar 14
whoisgregg: the code you posted appears to be exactly what I wanted but it just prints Dec 31 1969 52 times, the server I am working with has PHP 4.1 I think could that be the reason? is there a work around?
Thanks
for($i=1; $i<=52; $i++){
echo date("M d Y", strtotime('next Monday +'.$i.' week')).'<br>';
}
Any idea?
Edit: Coopster it was a mistake its the last version of 4 I am told
Edit2: got it, changed the $i=1 to $i=0
print "<select name=\"start\" size=\"1\">";
print "<option value=\"Select Week\" selected>Select Week</option>";
for($i=0; $i<=52; $i++){
$num = date("d M Y", strtotime('next Monday +'.$i.' week'));
print"<option value=\"{$num}\">{$num}</option> \n";
}
print "</select>";
Any help/advice