I have a custom page resources-search.php
template which handles search results for the search form. And in my function.php
I have the following array:
$YearList = array('2000','2001','2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012','2013');
Yes, You guessed it right. Its an array of year. In my resources-search.php
I' am using this code:
<select name="year" id="opt_year">
<option value="0" selected="true" disabled="true">Year</option>
<?php
foreach($YearList as $key => $value){
echo '<option value="'.$value.'">'.$value.'</option>'; //close your tags!!
}
?>
</select>
Its a drop-down menu from the array above. This method doesn't actually works for me. In other pages it does work but not in resources-search.php
.
Any ideas anyone?
range()
? How aboutrange( 2000, date("Y") );
? ;)