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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -