title: How to iterate through elements in DOMNodeList?
body: <p>I am having a problem iterating through elements in a DOMNodeList. I am trying to put a whole paragraph into a string. I can get each sentence separately using this:</p>
  
  <pre><code>$node = $paragraph-&gt;item(0);  //first line of the paragraph
  $node = $paragraph-&gt;item(1);  //second line of the paragraph
  </code></pre>
  
  <p>But I cannot seem to loop through all of the sentences and put them into the one string. I have tried this but it didn't work:</p>
  
  <pre><code>for($i=0; $i&lt;3; $i++)
  {
      $node = $paragraph-&gt;item($i); 
  }
  </code></pre>
  
  <p>Any ideas how I could do this?</p>