function get_string($h, $s, $e)
{
$sp = strpos($h, $s, 0) + strlen($s);
$ep = strpos($h, $e, 0);
return substr($h, $sp, $ep-$sp);
}
$testvar = "<table><td>7</td>
<td>2</td>
<td>4</td>
</table>";
$start = "<table>";
$end = "</table>";
$table = get_string($testvar, $start, $end);
Good luck. 🙂