Re: [PHP] drop down list of years puzzles me

2004-01-20 Thread Justin French
On Wednesday, January 21, 2004, at 10:10 AM, Bill Green wrote: This doesn't to create a drop down box of years: $curr_year = intval(date('Y')); $range = 10; for ($y=$curr_year; $y < $range; $y++) { echo "".$y."\n"; } Stop and read the for loop. You're saying "starting with the current ye

Re: [PHP] drop down list of years puzzles me

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 07:10, Bill Green wrote: > for ($y=$curr_year; $y < $range; $y++) { > echo "".$y."\n"; > } > > When I check for errors: > $curr_year = 2004 > $curr_year is an integer > $range = 10 > $curr_year + $range = 2014 > $y = 2004 $y < $range Do the substitution and wha

[PHP] drop down list of years puzzles me

2004-01-20 Thread Bill Green
This works to create a drop down select box of numbers 1-12: for($i=1; $i < 13; $i++) { echo "".$i."\n"; } This doesn't to create a drop down box of years: $curr_year = intval(date('Y')); $range = 10; for ($y=$curr_year; $y < $range; $y++) { echo "".$y."\n"; } When I check for errors: