I am trying to get the name of the month by passing the number of the month as a parameter to my function. I want it to appear in Spanish and I don't want to use the deprecated strftime function, I want to update my code to php 8 functions. I have been doing a lot of research and I have found the following:
$formatter = new \IntlDateFormatter(
'es_ES',
\IntlDateFormatter::LONG,
\IntlDateFormatter::LONG,
'Europe/Madrid'
);
return $formatter->format($mes);
but I don't know how I can pass the name of the month to IntlDateFormatter so that only September appears, for example.
I hope you can guide me a bit. I use native php, nothing from composer or external libraries
Thank you and regards