how to extract part of HTML page



Hi everyone,

I'm trying to write a PHP script that connects to a bank's currency convertor page using cURL and that part works fine. The issue is that I end up with a page that includes a lot of information that I don't need. Using the PHP function strip_tags I've ended with the text below and from the remaining HTML code, I'd like to extract the lines starting with "<TABLE BORDER="1" WIDTH="315">" up to its closing </TABLE> tag. How do I do this using PHP? I tried using preg_match and the like but my regex skills are pretty bad. Not too sure where to start. Could someone please provide me with some pointers?


=========================================================================================
<TABLE BORDER="0" WIDTH="600">
<tr>
<td width="148"></td>
<td width="448">some text some text some text some text some text</td>
</tr>
</TABLE>

<TABLE BORDER="0" WIDTH="600">
<TR><TD VALIGN="top" WIDTH="148">
</TD>
<TD WIDTH="448" VALIGN="top">
<TABLE BORDER="0" WIDTH="448">
<TR><TD>
some text some text some text some text some text some text some text some text some text some text.
some text some text some text some text some text
</TD></TR>
<TR><TD>
<TABLE BORDER="1" WIDTH="315"> <----- extract from here

<TR><TD>
some text some text some text some text some text
</TD>
<TD ALIGN="right">
some text some text some text some text some text
</TD></TR>
<TR><TD>
some text some text some text some text some text
</TD>

<TD ALIGN="right">
some text some text some text some text some text
</TD></TR>
<TR><TD>
some text some text some text some text some text
</TD>
<TD ALIGN="right">
some text some text some text some text some text
</TD></TR>
</TABLE> <--------- to here
</TD></TR>
<TR><TD>
a {
color:blue;
}
some text some text some text some text some text
some text some text some text some text some text some text some text some text some text some text
some text some text some text some text some text some text some text some text some text some text
</TD></TR>
<TR><TD>
some text some text some text some text some text
some text some text some text some text some text some text some text some text some text some text some text some
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
<br>
=========================================================================================


Thanks
Eric

.