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?
It depends. If str_replace works for your case, I think is faster and less memory consumer than preg_replace