<?php
$months = array();
for($i = 0; $i < 12; $i++){
$timestamp = strtotime("-$i month");
$value = date('n,Y', strtotime("-$i month"));
$text = date('F Y', strtotime("-$i month"));
$months[$value] = $text;
}
echo '<select>';
foreach($months as $value => $text){
echo '<option value="'.$value.'">'.$text.'</option>';
}
echo '</select>';
?>
$months = array();
for($i = 0; $i < 12; $i++){
$timestamp = strtotime("-$i month");
$value = date('n,Y', strtotime("-$i month"));
$text = date('F Y', strtotime("-$i month"));
$months[$value] = $text;
}
echo '<select>';
foreach($months as $value => $text){
echo '<option value="'.$value.'">'.$text.'</option>';
}
echo '</select>';
?>
No comments:
Post a Comment