在PHP中替换字符串的最快方法

问题描述:

我需要在PHP代码中替换一些字符串以使其看起来更好.最好的方法是什么?

I need to replace some string in a PHP code to make it look better. What would be the best way to go about that?

通常的怀疑者是 str_replace preg_replace .

The usual suspects would be str_replace and preg_replace.