I am trying to have a drop down box that will auto populate each year starting from 1900 and ending with $currentyear
can someone please help
Thanks
Jeff
Drop down box that auto populates years
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
simple loop:
Code: Select all
$output = '';
for($x = 1900; $x <= $currentyear; $x++)
$output .= '<option value="' . $x . '">' . $x . '</option>';
echo $output;