Forum Moderators: coopster
The date() function page says I should use setlocale() and strftime(), but setlocale() also says "The locale information is maintained per process, not per thread."
I'm not really up on what this means - I want the change of setting to only last for the length of the current page's processing - I don't want to change the core PHP locale, only the presentation of the current date from English to, say, Spanish.
Am I OK to use setlocale(), or should I use something different?
The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server api like IIS or Apache on Windows you may experience sudden changes of locale settings while a script is running although the script itself never called setlocale() itself. This happens due to other scripts running in different threads of the same process at the same time changing the processwide locale using setlocale().