Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created December 29, 2014 16:23
Show Gist options
  • Save bytefade/197f267f037a9618e374 to your computer and use it in GitHub Desktop.
Save bytefade/197f267f037a9618e374 to your computer and use it in GitHub Desktop.
ano
// --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