Created
December 29, 2014 16:23
-
-
Save bytefade/197f267f037a9618e374 to your computer and use it in GitHub Desktop.
ano
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --Retorna ano para select | |
function ano_select(){ | |
//The 60 value here is the amount of years to go back | |
$year = date("Y") - 100; | |
//The 60 value here is the amount of years to go forward | |
//because i went back 50 years, i'm going forward 50 years so the dropdown will always have the current year. | |
for ($i = 0; $i <= 82; ++$i) | |
{ | |
$year2[] = $year; | |
//increase year counter by 1 | |
++$year; | |
} | |
return $year2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment