how to display Object of class DOMElement in php
<p>need your help..
I've seen a great answer from <a href="http://stackoverflow.com/questions/3808746/dynamically-replace-the-src-attributes-of-all-img-tags-redux">Dynamically replace the “src” attributes of all  tags (redux)</a>, but I don't know how to display from the code below </p>

<pre><code>$dom=new DOMDocument();
$dom-&gt;loadHTML($your_html);
$imgs = $dom-&gt;getElementsByTagName("img");
foreach($imgs as $img){
    $alt = $img-&gt;getAttribute('alt');
    if ($alt == 'pumpkin'){
        $src = 'http://myhost.com/cache/img001.gif'; 
    } else if ($alt== '*'){
        $src = 'http://myhost.com/cache/img002.gif';
    } else if ($alt== 'cool image'){
        $src = 'http://myhost.com/cache/img003.jpg';
    }
    $img-&gt;setAttribute( 'src' , $src );
}
</code></pre>
