I need to replace special characters inside a string with other characters. For example a "ä" can be replaced by either "a" or "ae" and a "à" with "a" as well. Normally this is pretty easy to do with PHP and there are lots of functions on stackoverflow, which already do excactly that.
Unfortunately my string looks like this: "u\u0308 a\u0302 a\u0308 o\u0300.zip" (ü â ä ò.zip). As you might see my strings are file names and OSX seems to convert the characters to unicode (at least that is what i think).
I know that i could use a very long array with all special characters to replace them in PHP:
$str = "u\u0308 a\u0302 a\u0308 o\u0300.zip";
$ch = array("u\u0308", "a\u0302", "a\u0308", "o\u0300");
$chReplace = = array("u", "a", "a", "o");
str_replace($ch, $chReplace, $str);
But I'm wondering if there is an easier way, so I don't have to do this manually for every character?