[eluser]IanMcQ[/eluser]
I have this function as a plugin:
Code:
function wordchar($str)
{
return (strspn($str, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-') == strlen($str));
}
I use it to check if a string is an alphanumerical word character. However, characters such as ä, Ç, ö, ü, etc are getting past this function. In other words, if $a contains "ö", this function will still return TRUE despite ö's being prohibited!
My question is this: what does CodeIgniter convert characters to (I am using $this->input->post() to get the value of the string I'm checking)? My guess is that characters like ö are being translated into something different. How can I make it so these characters (like ö) don't get past this function?
ALSO -- ö's (among the others) pass through a similar preg function without detection.
Thanks.