I'm writing codes for show years and months of past years
ex
<select>
<option value="03/2014">03/2014</option>
<option value="02/2014">02/2014</option>
<option value="01/2014">01/2014</option>
<option value="12/2013">12/2013</option>
<option value="11/2013">11/2013</option>
<option value="10/2013">10/2013</option>
</select>
im using this code but i can get only moonth names
$i = 1;
$month = time();
while($i <= 12)
{
$month_name = date('F', $month);
echo '<option value="'. $month_name. '">'.$month_name.'</option>';
$month = strtotime('+1 month', $month);
$i++;
}
but i need to get month and year for past 4,5 years, anyone know how to that using php date function or any other short way.thank you