Avoid preg_replace() for simple cases

Use the faster str_replace() and str_ireplace() instead.
From http://www.php.net/manual/function.str-replace.php : "If you don't need fancy replacing rules (like regular expressions), you should always use this function instead of preg_replace(). "