The following piece of code should iterate through the months printing
out the months and years combined. However date seems to have a
preference for December 1969 after February 2004 (which of course, we
all know, should be March 2004). After it prints 1969 it will happily
print April 2004 as though nothing happened:
$td = date("j");
$tm = date("MY");
# MonthsYears
for ( $i = 0; $i <=6 ;$i ++){
$theday = mktime(0,0,0,da te("m")+$i ,date("d") ,date("Y"));
$option =date("M y", $theday ); // Set how it will look.
echo "$option<br >";
}
this will print out
Oct 03
Nov 03
Dec 03
Jan 04
Feb 04
Dec 69
Apr 04
which errr isnt right.
Any ideas gratfully recevied. This cant be the first time!
PHP Version 4.3.3
will
out the months and years combined. However date seems to have a
preference for December 1969 after February 2004 (which of course, we
all know, should be March 2004). After it prints 1969 it will happily
print April 2004 as though nothing happened:
$td = date("j");
$tm = date("MY");
# MonthsYears
for ( $i = 0; $i <=6 ;$i ++){
$theday = mktime(0,0,0,da te("m")+$i ,date("d") ,date("Y"));
$option =date("M y", $theday ); // Set how it will look.
echo "$option<br >";
}
this will print out
Oct 03
Nov 03
Dec 03
Jan 04
Feb 04
Dec 69
Apr 04
which errr isnt right.
Any ideas gratfully recevied. This cant be the first time!
PHP Version 4.3.3
will
Comment