View Full Version : string encoding problem

04-23-2009, 08:40 PM
I have a form with is submitting a string to a php page. the string is "oh es"... as you can see the y has an accent on top of it... this is because the y is a diacritic. I want to change the back into a y but i can not seem to find a command to do it ...i tried this but it didnt work

$thestring= str_replace('', "y", $thestring);

but the result is still "oh es".


04-23-2009, 10:13 PM
It replaced it just fine for me. Are you maybe calling the same variable name twice somewhere?

$string = "oh es";

$thestring = str_replace('', 'y', $string);

echo $string . '</br>';
echo $thestring;

04-23-2009, 11:14 PM
it also works fine when i do it that way ... but when i am submitting the string from a form on the previous page.. everything gets messed up.... on the previous the page has utf= encoding.

04-23-2009, 11:16 PM
Can you post your form? Hard to help without seeing the code.

04-24-2009, 07:01 AM
It is just a simple form

<form name="form1" action="aftertestersignup.php">

<input type="text" name="string" >