Convert Month Numbers to Month Names in PHP


Here is a lovely bit of code to help you convert months in numbers to proper names!

<?php
 $monthNum = 11;
 $monthName = date("F", mktime(0, 0, 0, $monthNum, 10));
 echo $monthName; // Outputs: November
 ?>

Leave a Reply

Your email address will not be published. Required fields are marked *