Re: problem with strtolower()
| From: | Martin Wickman | Date: | Fri, 17 May 2002 13:55:36 +0000 |
| Subject: | Re: problem with strtolower() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98086@lists.php.net to get a copy of this message | ||
David Orn Johannsson wrote:
I'm having a problem with StrToLower function in php I'm trying to convert characters like Þ and acute letters from uppercase to lowercase, but it dosen't work. this is what the manual says: "Note that 'alphabetic' is determined by the current locale. This means that in i.e. the default "C" locale, characters such as umlaut-A (Ä) will not be converted." dose this mean that it dosen't return acute and other letters like that or is it a matter of configuration on the server?Well, here is the actual loop which does the lowering for you:
for (i=0; i<len; i++) {
ch = tolower((unsigned char)*c);
*c++ = ch;
}
return (s);
It is using the std c-function tolower()
man tolower tells me
NAME
toupper, tolower - convert letter to upper or lower caseRETURN VALUE The value returned is that of the converted letter, or c if the conversion was not possible. So I take it all weird characters are just left alone and returned to you, as is.