April 2, 2011, 7:23 p.m.
posted by stackme
Setting the Default Locale
At the beginning of a file loaded by the auto_prepend_file configuration directive, call setlocale( ) to set your desired locale, as in Figure.
Setting a default locale
To use whatever default is set by the system environment variables, pass null as the locale to setlocale( ), as in Figure.
Setting a default locale based on system environment
Even if you set up appropriate environment variables before you start your web server or PHP binary, PHP doesn't change its locale until you call setlocale( ). After setting environment variable LC_ALL to es_US, for example, PHP still runs in the default C locale.
Recipe 19.2 shows how to use a particular locale; documentation on setlocale( ) at http://www.php.net/setlocale and auto_prepend_file at http://www.php.net/manual/en/configuration.directives.php#ini.auto-prepend-file.