Menu


Need a Website Or Web Application Or Any Help In Code As Per Your Budget, Contact Us: +91 9437911966 (Whatsapp)

How to convert string number into month name in PHP


<!DOCTYPE html>
<html>
<body>
<?php
    $monthNum  = 1;/*Here 1 is the month number*/
	$dateObj   = DateTime::createFromFormat('!m', $monthNum);/*Convert the number into month name*/
	$monthName = $dateObj->format('F');
	echo $monthName;
?>
</body>
</html>

Output:

January