I usually try to build UTF-8 support into the sites and web applications I build. In PHP land that usually means using the multibyte string extension mbstring. A number of people have noticed, though, that there are some often used PHP string functions with no mbstring equivalent. One of those functions is str_replace().
So for anyone looking for a mb_str_replace() function the one below should serve you nicely. It should work in exactly the same manner as str_replace().