PHP setlocale
This section describes the use of the PHP setlocale function.
Take care when using the PHP setlocale function. The setlocale function changes the locale settings for the entire process, not just the current thread. Therefore a request could find it's local settings changed if another request happens to call setlocale at the same time. In addition at the end of each request, all locale settings will be automatically reset to the "C" locale except for LC_TYPE which will be reset to the environmental value.