I don't know of a direct way other than a string comparision.
[PHP]
$start = strpos($str, "string"); // use this to get right before the first tag
$start = strpos($str, "string", $start); //(optional) use this to get right before the first tag if the line above only get to two tags before, use as many as neccessary
$start = strpos($str, "<td>", $start) + 4;
$end = strpos($str, "</td>", $start) ;
$length = $end - $start;
$contents = substr($str, $start, $length);
[/PHP]
This will capture all the text between the <td></td> tags. It will be in matches[1].
You would need to read the html file into a string, using file_get_contents(). You could run a regular expression to capture just the table you want. But you should change your HTML, place the table titles in the <caption> tag, then you can modify the expression above to capture between caption tags.
after you get what in between the <td> / <tr> tag use
$contents = strip_tags($contents);
This does exactly what it sounds like, it strips all tags so everything between a < and a > goes away, all of them. You can also chose to keep certain ones. For futher reference: http://us3.php.net/strip_tags.
Cheers,
Happy Thanksgiving
after you get what in between the <td> / <tr> tag use
$contents = strip_tags($contents);
This does exactly what it sounds like, it strips all tags so everything between a < and a > goes away, all of them. You can also chose to keep certain ones. For futher reference: http://us3.php.net/strip_tags.
Cheers,
Happy Thanksgiving
hai try this code..i think this is working perfectly