note 25335 added to function.strtolower
| From: | tty01_at_rambler_dot_ru at rack1 dot php dot net | Date: | Fri, 20 Sep 2002 00:58:52 +0000 |
| Subject: | note 25335 added to function.strtolower | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37005@lists.php.net to get a copy of this message | ||
Another solution for Double-Byte-Characters, based on iconv() functions, not sensible to the current
locale, works on win32.
/* Converts charset */
function myConvertCharset($str, $from, $to)
{
if(@function_exists('iconv'))
{
return iconv($from, $to, $str);
}
else if(@function_exists('recode_string'))
{
return recode_string($from . '..' . $to, $str);
}
else
{
print "function iconv not exists";
return $str;
}
}
/* Converts a string to lowercase */
function my_strtolower($s)
{
$t = "windows-1251";
$d = "UTF-8";
return myConvertCharset(strtolower(myConvertCharset($s, $d, $t)), $t, $d);
}
print my_strtolower("СÐÐÐÐ Uppercase");
--
http://www.php.net/manual/en/function.strtolower.php
http://master.php.net/manage/user-notes.php?action=edit+25335
http://master.php.net/manage/user-notes.php?action=delete+25335
http://master.php.net/manage/user-notes.php?action=reject+25335