In this Article I’ll explain you how you can replace French letters with their English letters. In some cases you may need to change French special characters with their English letters for your target audience. Like Š => S š => s Ð => Dj Ž => Z You can replace these letters with too many methods. But here I’ll highlight 2 methods: strtr — Translate characters or replace substrings str_replace — Replace all occurrences of the search string with the replacement string Replace French letters with ‘strtr’ function Translating the letters:
$normalizeChars = array(
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A'
$string = strtr($string, $normalizeChars);
In above example strtr function will search the key (array-key of second parameter) and will replace with its respective value. Because we have passed second parameter as …Read More