extracting webpage content through php
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3577641/how-to-parse-and-process-html-with-php">How to parse and process HTML with PHP?</a>  </p>
</blockquote>



<pre><code>&lt;body&gt; 
    &lt;table align="center"&gt;

&lt;?
 $ip=$_SERVER['REMOTE_ADDR'];
 $url=file_get_contents("http://whatismyipaddress.com/ip/$ip");
 preg_match_all('/&lt;th&gt;(.*?)&lt;\/th&gt;&lt;td&gt;(.*?)&lt;\/td&gt;/s',$url,$output,PREG_SET_ORDER);
 for ($q=0; $q &lt; 25; $q++) {
    if ($output[$q][1]) {
        if (!stripos($output[$q][2],"Blacklist")) {
            echo "&lt;tr&gt;&lt;td&gt;".$output[$q][1]."&lt;/td&gt;&lt;td&gt;".$output[$q][2]."&lt;/td&gt;&lt;/tr&gt;";

        }
    }
}
?&gt; 
    &lt;/table&gt;
&lt;/body&gt; 
</code></pre>

<p>Now, with this code I get a lot of information like isp,country, etc.</p>

<p>How can I extract the content so that I load them into my database like $country , $isp , etc? I think it can be done if it's converted to xml but I'm not sure. </p>
