I need to replace some line in PHP code so that it looks better. What would be the best way to do this?
The usual suspects are str_replaceand preg_replace.
str_replace
preg_replace
This is a good way to go and use regular expressions so that you have the flexibility to do this.
(, - , ), sed .
man sed
It depends. If str_replace works for your case, I think it's faster and less memory consumer than preg_replace