Hello,
I have country names (in french with accents and all), and I want to make a link between that, and names in upper case, without accents.
At first I thought it would be VERY easy to do:
I take the list of french names from my database.
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$name = $row['french_name'];
$name = strtr($name, 'éèàï', 'eeai');
$name = strtoupper($name);
//do something with the $name
}
The problem is... after strtr (or str_replace, or any replacing function), the variable still contains accuented letters...
The name in the database: Brésil
The name after strtr AND strtoupper: BRÉSIL
But If I test the functions like this:
$test = 'été';
$test = strtr($test, 'é', 'e');
echo $test;
I get: ete...
So, why does it work when I assign a string to a variable manually, but NOT when I get the string from a MySQL ressource?
It is really really weird.
I checked, and my variable is a string, I tried settype and other stuff, but nothing worked...