str_replce() not working in loop foreach?
<p>I have a sample code:</p>

<pre><code>$str = array(
    '1' =&gt; 'abc',
    '2' =&gt; 'def',
    '3' =&gt; 'abc'
);
foreach($str as $element) {
$str_rep = str_replace('abc', '123', $str); 
}
echo $str_rep;
</code></pre>

<p>OUTPUT:</p>

<pre><code>$str = array(
    '1' =&gt; 'abc',
    '2' =&gt; 'def',
    '3' =&gt; '123'
);
</code></pre>

<blockquote>
  <p>Error when '1' => 'abc' not replaced ? How to fix it ?</p>
</blockquote>
