title: Need to replace words in text with custom synonyms
body: <pre><code>$string='print the imprint with the imprinted printing paper';
  
  $pattern=array('/print/','/imprint/','/paper/',);
  $replacement=array('imprint','print','machine');
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>print the imprint with the imprinted printing machine
  </code></pre>
  
  <p>I think I understand correctly that the first two patterns are overriding each other. I am thinking of making this even more complex, but REGEX is still voodoo to me. With the input string shown, I'd like to get this back: <code>imprint the print with the printed imprinting machine</code>. If I could also see how to make it output <code>imprint the print with the imprinted printing machine</code>, that would be great too. </p>
  
  <p>If you could explain your regex, that would be more helpful. Maybe I'll be able to do more on my own afterward.</p>