Convert Month Number to Month Name in PHP
There is a very simple method to convert a month number to a month name in PHP, without using the lenghty switch statement.
<?php
$month_number = 11;
$month_name = date("F", mktime(0, 0, 0, $month_number, 10));
echo $month_name; //output: October
$month_name = date("M", mktime(0, 0, 0, $month_number, 10));
echo $month_name; //output: Oct
$month_total_days = date("t", mktime(0, 0, 0, $month_number, 10));
echo $month_total_days; //output: 31
?>