Skip to content

Instantly share code, notes, and snippets.

@atticoos
Created April 17, 2014 04:11
Show Gist options
  • Save atticoos/10952297 to your computer and use it in GitHub Desktop.
Save atticoos/10952297 to your computer and use it in GitHub Desktop.
<?php
function card_month_options(){
$months = array('01','02','03','04','05','06','07','08','09','10','11','12');
foreach ($months as $month): ?>
<option value="<?php echo $month; ?>"><?php echo $month; ?></option>
<?php endforeach;
}
/* Products
<select>
<option>01</option>
<option>02</option>
....
*/
function card_year_options(){
$currentYear = date("Y");
for ($i=0; $i<10; $i++):
$year = date("Y", strtotime("+$i year"));
?>
<option value="<?php echo $year; ?>"><?php echo $year; ?></option>
<?php endfor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment