-
[RESOLVED] Format month
If the number is 4 then I want to convert it to month of april.
I've tried strftime function but it accept the full date not just a number.
strftime("%B", $date);
How can I achieve that converting a single number into month?
Thanks in advance for all help mate.
-
Re: Format month
Easiest way I can think of is to make an array with all months.
PHP Code:
$months = array(
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
);
$monthID = 4;
echo $months[$monthID - 1];
-
Re: Format month
So there will be no other way in doing that?
Well making an array is good enough. Thanks for the reply mate. :)