Error when replace alt in image tag?
<p>I have a test code using simple_dom_html:</p>

<pre><code>&lt;?php
include 'simple_html_dom.php';
$content = '&lt;img src="name1.jpg" alt="name"&gt;&lt;img src="name2.jpg" alt="name2"&gt;';
$html = new simple_html_dom();
$html-&gt;load($content);
$array_alt = array();
foreach($html-&gt;find('img') as $element) {
    $element-&gt;src = "new src";
    $array_alt[] = $element-&gt;alt;
}
for($i=0; $i&lt;count($array_alt); $i++) {
    $array_alt[$i] = "test" . $i;
}
echo $html;
</code></pre>

<p>OUTPUT:</p>

<pre><code>$html= '&lt;img src="new src" **alt="name"**&gt;&lt;img src="newsrc" **alt="name2"**&gt;';
</code></pre>

<p>Error when echo $content, alt not change from name "name1", "name2" to "test1", "test2", how to fix it ?</p>
