The example in this article describes how to generate a drop-down list of the past 100 years in php. Share it with everyone for your reference. The details are as follows:
Year selection is often used in projects. This code automatically generates a drop-down list of the past 100 years starting from this year
<select name="year"> <?php $years = range(date("Y"), date("Y", strtotime("now - 100 years"))); foreach($years as $year){ echo'<option value="'.$year.'">'.$year.'</option>'; } ?> </select>
I hope this article will be helpful to everyone’s PHP programming design.