Good Evening folks.
This is my code:
static private function removeAccentedLetters($input){
for ($i = 0; $i < strlen($input); $i++) {
$input[$i]=self::simplify($input[$i]);
}
return $input;
}
static private function simplify($in){
$ord=ord($in);
switch ($ord) {
case 193: //Á...
return 'A';
case 98: //b
return 'a';
default:
return $in;
}
}
Ok. This is the bit that doesn't work
case 193: //Á...
return 'A';
And this is the bit that does:
case 98: //b
return 'a';
These are just for testing purposes.
Could anyone tell me what's happening? I had the same sort of error before but now I'm not using any extended ASCII in the code itself, which was the cause of error before.
I'm thinking it must have something to do with character encoding but I'm not sure. By the way, I'm coding in Eclipse and, according to it, the character encoding I'm using is Cp1252.
Oh, and yes, the code is supposed to eliminate any accented Letters such as á à and replace them with their basic vogals, i.e. á->a
Thanks in advance