如何使用PHP将数字月份数转换为月份名称

I have a variable with a 2 digit month number. Is there a built in function that allows me to change it to the month name. I thought maybe the date() function would work, but that requires a full timestamp.

You can use mktime with arbitrary parameters (exception of month) and then format using date (this might buy you something as far as locales).

 date('M', mktime(0, 0, 0, $month, 1, 2000));

Not to my knowledge.

You could use:

<?php
$monate = array(
   1=>"Januar",
   2=>"Februar",
   3=>"März",
   4=>"April",
   5=>"Mai",
   6=>"Juni",
   7=>"Juli",
   8=>"August",
   9=>"September",
   10=>"Oktober",
   11=>"November",
   12=>"Dezember");
?>

<?php
$monat = date("n");
??

I use the following which is easier to code when needed many times

$month_names = array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

echo $month_names[3]; //prints March

Useful if you have a header or config file that's included on all your pages