Proper string functions working with different locale settings.
php russian cyrillic string functions locale set_locale strtolower strtoupper regex regexp preg_match preg_replace ereg strtr example problem
<?
/*
show system available locales:
[]# locale -a
...
...
pt_PT.ISO8859-15
pt_PT.UTF-8
ro_RO.ISO8859-2
ro_RO.UTF-8
ru_RU.CP1251
ru_RU.CP866
ru_RU.ISO8859-5
ru_RU.KOI8-R
ru_RU.UTF-8
sk_SK.ISO8859-2
sk_SK.UTF-8
sl_SI.ISO8859-2
sl_SI.UTF-8
sr_YU.ISO8859-2
sr_YU.ISO8859-5
sr_YU.UTF-8
sv_SE.ISO8859-1
...
...
*/
setlocale(LC_ALL, 'ru_RU.CP1251');
// then use STRTOLOWER, STRTR, STRTOUPPER, PREG_MATCH, PREG_REPLACE
// and other string functions
?>
2008-09-29, Uzaren