for($x=0; $x<12; $x++) { $month = mktime(0, 0, 0, date(\"m\")+$x, date(\"d\"), date(\"Y\")); $key = date(\'m\', $month); $monthname = date(\'F\', $mo
Sometime you need to be careful on your locale, so this is my solution (in a function):
$months = []; for ($x=1; $x < 13; $x++) { $time = mktime(0, 0, 0, $x, 1); $key = date('m', $time); $name = ucfirst(strftime('%B', $time)); $months[(int)$key] = $name; } return $months;