PHP Using domdocument to extract data from html
<p>I have a table with the following structure. I cannot seem to get the data I want.</p>

<pre><code>&lt;table class="gsborder" cellspacing="0" cellpadding="2" rules="cols" border="1" id="d00"&gt;
 &lt;tr class="gridItem"&gt;
  &lt;td&gt;Code&lt;/td&gt;&lt;td&gt;0adf&lt;/td&gt;
 &lt;/tr&gt;&lt;tr class="AltItem"&gt;
  &lt;td&gt;CompanyName&lt;/td&gt;&lt;td&gt;Some Company&lt;/td&gt;
 &lt;/tr&gt;&lt;tr class="Item"&gt;
  &lt;td&gt;Owner&lt;/td&gt;&lt;td&gt;Jim Jim&lt;/td&gt;
 &lt;/tr&gt;&lt;tr class="AltItem"&gt;
  &lt;td&gt;DivisionName&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;&lt;tr class="Item"&gt;
  &lt;td&gt;AddressLine1&lt;/td&gt;&lt;td&gt;9314 W. SPRING ST.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>This table is of course nested within another table within the page. How can I use DomDocument for example to refer to "Code" and "0adf" as a key value pair? They actually don't need to be in a key value pair but I should be able to call them each separately.</p>

<p>EDIT:</p>

<p>Using PHP Simple HTML, I was able to extract the data I needed using this:</p>

<pre><code>  $foo = $html-&gt;getElementById("d00")-&gt;childNodes(1)-&gt;childNodes(1);
</code></pre>

<p>The problem with this though is that I am getting the two <code>&lt;td&gt;&lt;/td&gt;</code> tags with my data. Is there a way to only grab the raw data without the tags?</p>

<p>Also, is this the right way to get my data out of this table?</p>
