tags:

views:

210

answers:

1

Heya all. I want to make sure some string replacement's I'm running are multi byte safe. I've found a few mb_str_replace functions around the net but they're slow. I'm talking 20% increase after passing maybe 500-900 bytes through it.

Any recommendations? I'm thinking about using preg_replace as it's native and compiled in so it might be faster. Any thoughts would be appreciated.

A: 

why wouldn't str_replace be multi-byte safe? it is so you don't need mb_str_replace..

darma
As to `str_replace` being safe... this depends on the text being replaced and the encoding of the data.
Artefacto
haha. can you give me the context in which it is safe? from what i understand the executing file needs to be saved as utf8 and the content coming in needs to be utf8. is that so?
onassar