title: Replace multiple strings with multiple array
body: <p>I'm trying to replace multiple words in a string with multiple array. The string is "I have a wife, a car, and a home a boat."</p>
  
  <pre><code> function CorrectString(text){
       CorrectionArr = array(
           'cat'=&gt;array('wife'),
           'pen'=&gt;array('boat', 'car')
       );
   }
  
   var text = "I have a wife, a car, and a home a boat.";
   text = CorrectString(text);
  </code></pre>
  
  <p>after replace</p>
  
  <pre><code> var text = "I have a cat, a pen, and a home a pen.";
  </code></pre>