Note: I think that I probably know incorrectly, so please kindly correct my knowledge :)
I just answered the question about UTF-8 and PHP.
I suggested using str_ireplace('', '', $a) .
I did not expect this to work, but it did.
I always thought that PHP treats one byte as one character, so to use accurate results when using characters outside the ASCII range you need to use the mb_* functions.
I suggested that Russian characters will take 1 byte each.
I thought str_replace() would work, because bytes can be matched regardless of whether they are multi-byte or not, if they are ok.
I thought str_ireplace() would not work, because PHP would not know how to match non-ASCII characters to their equivalent alternative case. But it really worked.
Where and how am I mistaken? Provide me as much information as you can :)
alex
source share