title: Read data from HTML table with PHP
body: <p>Lately I've had a question, what I'm trying to do is read data from an HTML table and grab the data into a variable called <code>$id</code>. For example I have this code:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;413&lt;/td&gt;
  &lt;td&gt;Party Hat&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;No&lt;/td&gt;
  &lt;td&gt;&lt;a href="http://clubpenguincheatsnow.com/tools/swfviewer/items.swf?id=413"&gt;View SWF&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>What I want to do is that another variable called <code>$array[$i]</code> which is holding a search query. I want my PHP code to search through the table until it finds the section with that specific query in it. In this case is would be "Party Hat." What I want it to do after it finds the query is for it to look at the ID which is the "td" section above the name "Party Hat" the ID in this case is 413. After this I want the variable $id to hold the ID. How do I do this? Any help would be <strong>HIGHLY</strong> appreciated!</p>