![]() |
Years select list
How can I echo 10 years from today in a select list?
For example. 2007 2008 2009 2010 2011 2012 2013 ... |
I researched on php
range(); function and learned how to do it.PHP Code:
|
Something like this, perhaps. Less function calls.
PHP Code:
|
Or, even less function calls (aka. why call
date('Y') twice?):PHP Code:
range is very helpful in many circumstances. |
This is more customizable (Change $yearsToGoBack):
PHP Code:
|
| All times are GMT. The time now is 09:18 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0