title: php DOMDocument line of table to text
body: <p>I got the following:</p>
  
  <pre><code>$table      = $dom-&gt;getElementsByTagName('table')-&gt;item(1);
  $row        = $table-&gt;getElementsByTagName('tr')-&gt;item(0)-&gt;getElementsByTagName('td');
  </code></pre>
  
  <p>I would like to get a array with the textContent of all the td elements into an array. </p>
  
  <p>I could manually do this using something like</p>
  
  <pre><code>foreach ($row as $col) {
              $array[] = $col-&gt;textContent;
  }
  </code></pre>
  
  <p>But I am sure there must be a function how to automatically do this.</p>