title: preg_replace with a word in an array
body: <p>I am trying to use certain words in a array called <code>keywords</code>, which will be used to be replaced in a string by "as". </p>
  
  <pre><code>for($i = 0; $i&lt;sizeof($this-&gt;keywords[$this-&gt;lang]); $i++)
      {
          $word = $this-&gt;keywords[$this-&gt;lang][$i];
          $a = preg_replace("/\b$word\b/i", "as",$this-&gt;code);
      }
  </code></pre>
  
  <p>It works with if I replace the variable <code>$word</code> with something like <code>/\bhello\b/i</code>, which then would replace all hello words with "as".</p>
  
  <p>Is the approach am using even possible?</p>