I have this code, but it doesn't work for me. I tried it myself. Please tell me how to make it show me the years in a dropdown list from the year 1945 to the current year.
<select name="year">
<option value="0">Año</option>
<?php
$year = date("Y");
for ($i= 1945; $i < $year+1 ; $i++) {
echo'<option VALUE="'+$i+'">'+$i+'</option>';
}
?>
</select>
Or else try this code
The most correct is like this
Friend, change the portion of code where you print through PHP your :
In PHP, the punctuation mark is used to concatenate a String . and not the plus sign +
Maybe you are not concatenating the years correctly in the "echo" test with the following code