I need to convert the number of the month to the name of the same, but it has to be in Portuguese (and preferably without the need of substr
)
I can do this, with the default language in English
$monthNum = 3;
$dateObj = DateTime::createFromFormat('!m', $monthNum);
$monthName = $dateObj->format('F');
echo substr($monthName, 0, 3);
// output Mar
Is there a way to change the language type to pt-Br to use this function?
I do not want to create a array()
containing all the months already abbreviated and in Portuguese. I want a solution in-built