How to take care of this ... $tradus=str_replace('ă','a',$tradus); $tradus=str_replace('î','i',$tradus); $tradus=str_replace('é','e',$tradus); $tradus=str_replace('ô','o',$tradus); ?! its not working this way ... and i need to make the text ASCII compatible 100%
I don't know if this helps.. $search_array = array("ă", "î", "é", "ô"); $replace_array = array("a", "i", "e", "o"); $tradus = str_replace($search_array, $replace_array, $tradus);
The point is - WHAT is not working? The str_replace-items posted in the original post should work just fine, if the characters are in the text. So... what isn't working?
Yes, it does. Although I didn't have that first char, the ă when I copied the text to my Notepad++ (guess it's not in the charset I use). But, however, this code: <?php $tradus = "înteresting, éxperiment, ôverwhelming"; $tradus=str_replace('a','a',$tradus); $tradus=str_replace('î','i',$tradus); $tradus=str_replace('é','e',$tradus); $tradus=str_replace('ô','o',$tradus); echo $tradus; ?> PHP: gives this result: interesting, experiment, overwhelming so it is working just fine.