title: php replace all occurances of key from array in string
body: <p>maybe this is duplicate but i did't find good solution.</p>
  
  <p>I have array</p>
  
  <pre><code>$list = Array
  (
     [hi] =&gt; 0
     [man] =&gt; 1
  );
  $string="hi man, how are you? man is here. hi again."
  </code></pre>
  
  <p><strong>It should produce</strong> <code>$final_string = "0 1, how are you? 1 is here. 0 again."</code></p>
  
  <p>How can I achieve it with smart way? Many thanks.</p>