PHP str_replace not working in my case
<p>I am trying to do string replace on an array.</p>

<p>I have..</p>

<pre><code>str_replace('texts', 'testssssss', $test-&gt;html);
</code></pre>

<p>The <code>$test-&gt;html</code> returns</p>

<p>and I want to replace all texts to testssssss..</p>

<pre><code>key 1

&lt;div&gt;
   &lt;a href='texts.company.name.html'&gt;test&lt;/a&gt;
&lt;/div&gt;



Key 2

&lt;div&gt;
    other html...
&lt;/div&gt;


Key 3

&lt;div&gt;
    other html...
&lt;/div&gt;

Key 4

&lt;div&gt;
   &lt;a href='texts.department.name.html'&gt;department&lt;/a&gt;
&lt;/div&gt;

more...
</code></pre>

<p>Thanks for the help!</p>
