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.
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
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");
??
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.