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.
Thanks!
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.
Thanks!
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");
??
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));