There are many ways to print a month from the given number. Pick one suite for you.
1. date() function along with parameter 'F'
Code example:
$month_num = 10;
echo date("F", mktime(0, 0, 0, $month_num, 10)); //output: October
2. By creating php date object using createFromFormat()
Code Example
$dateObj = DateTime::createFromFormat('!m', $monthNum);
echo "month name: ".$dateObj->format('F'); // Output: October
3. strtotime() function
echo date("F", strtotime('00-'.$monthNum.'-01')); // Output: October
4. mktime() function
echo date("F", mktime(null, null, null, $monthNum)); // Output: October
5. By using jdmonthname()
$jd=gregoriantojd($monthNum,10,2019);
echo jdmonthname($jd,0); // Output: Oct
strtotime
has no idea what your trying to do. Alternatively just use a switch for something like this.strtotime
has no idea what "8" means.strtotime
parses complete timestamps like "2012-05-12 08:43:12". What does "8" mean in this context?echo date( "F", time() );
? For example,echo date( "F", strtotime("2019-03-09") );
will output "March"