Problems with the operation of the strtoupper() and strtolower() functions with Cyrillic


Problems when working with Cyrillic in the PHP scripts of the strtoupper() and strtolower() functions occur when the current locale (locale) is incorrectly defined. To determine it correctly, use the setlocale() function at the very beginning of your PHP script:



setlocale
(LC_ALL, 'ru_RU.CP1251');

echo
strtoupper('It works!');

?>