I would like to add the years 2011-2001 in my drop-down-box (2012-2002 in next year, etc...).
Since I don't want to change my code I thought to do it in php.
I had it like this which worked:
<select name="purchaseYear" size="1">
<?echo "<option>" . date("Y") . "</option>";?>
<?echo "<option>" . date("Y") - 1 . "</option>";?>
...
</select>
Now I want to realise it with a for-loop and tried it like this:
<select name="purchaseYear" size="1">
<?
for ($i = 0; $i <= 9; $i++) {
echo "<option>" . date("Y") - $i . "</option>";
}
?>
</select>
Which gave me an empty drop-down-box.
What do I need to change? And why didn't it work?