title: php DOMDocument How to convert node value to string
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3805207/how-can-i-get-an-elements-serialised-html-with-phps-domdocument">How can I get an element&#39;s serialised HTML with PHP&#39;s DOMDocument?</a><br>
    <a href="https://stackoverflow.com/questions/5404941/php-domdocument-outerhtml-for-element">PHP + DOMDocument: outerHTML for element?</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to extract all img tags from a string. I am using:</p>
  
  <pre><code>$domimg = new DOMDocument();
  @$domimg-&gt;loadHTML($body);
  $images_all = $domimg-&gt;getElementsByTagName('img');
  
  foreach ($images_all as $image) {
    // do something
  }
  </code></pre>
  
  <p>I want to put the src= values or even the complete img tags into an array or string.</p>