Fastest way to replace string in PHP

前端 未结 4 902
暗喜
暗喜 2020-12-07 01:51

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?

4条回答
  •  悲&欢浪女
    2020-12-07 02:40

    It depends. If str_replace works for your case, I think is faster and less memory consumer than preg_replace

提交回复
热议问题