php - Scope of setlocale function? -


i want sort array in php contains german 'umlaute'. not seem easy task php. found following example on web:

$oldlocale=setlocale(lc_collate, "0"); setlocale(lc_collate, 'de_de.utf8'); usort($countrys, 'strcoll');  setlocale(lc_collate, $oldlocale); 

this working expected. question is, scope of setlocale? limited current function in, limited thread, session or global?

i afraid of creating race conditions, cannot find other information on than:

the setlocale() function sets locale information.

it global setting, keeps set last value while script running. it's not related sessions, it's scope php process itself.

http://php.net/manual/en/function.setlocale.php


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -