Browsing articles for: May, 2009

Permalink to PHP Tip #6: str_replace Is Faster

PHP Tip #6: str_replace Is Faster

On 05.26.2009 by Paul Robinson | 1 comment

This is probably a very well known tip, but for those new to PHP it’s handy. When needing to replace something try & use str_replace instead of preg_replace. Always remember that REGEX is costly & should only be used when it is really needed. If you need to do a case insensitive replace then use [...]