Here’s a quickie for you. Ever wanted to convert a month number to a month name in PHP but hated having to do a huge switch statement? Well here is your answer.
<?php $monthNum = 5; $monthName = date("F", mktime(0, 0, 0, $monthNum, 10)); echo $monthName; //output: May ?>
Enjoy.






Thank you ,Really a vary usefull code
Nice piece of code. Thanks a lot for your time to post. Was really useful.
Thank You Friend!
Thank You For Your code!
Hi Guys. Glad you like the code. Hope it is useful.
Thanks for posting this code, it was really helpful.
Like it, but what’s the 10 for?
@Clive thanks. The 10 is just a day that each month has. It could probably be 1 or 0 and still work.
I see. Thanks for that.