Rewritten to use str_replace() instead of preg_replace()