The replaceAll() method returns a new string with all matches of a pattern replaced by a replacement. The join() method returns a new string by concatenating all of the elements in an array. Asking for help, clarification, or responding to other answers. Be careful not to accidentally quote your regex e.g. Found inside – Page 110Table 1: A section of PHP coding used to remove HTML for the agent to process $search = array ("'