- Get month name from integer with php.
- How to get month name from number with php.
This function accepts a number value and returns month name against it.
Function
public static function getMonth($month){
return date('F', mktime(0,0,0,$month,1));
}
Calling The Function
echo getMonth(10);
Output
October

Leave A comment
Email address is optional and will not be published. Only add email address if you want a reply from blog author.
Please fill required fields marked with *