Dynamically generate years in PHP

Sometimes we need to select year value from drop-down and for that we hardcode the year values in HTML option fields. It may me cumbersome at the point when we want to add a new year value to the option field as the year value grows as the time progresses. So it is possible to dynamically generate the year values using PHP and we can use those generated year values in HTML select option tag.

You may also read Dynamically generate months in PHP

Continue reading “Dynamically generate years in PHP”