$strIn = str_replace("/.?<TABLE/i", "<table", $strIn);
$strIn = str_replace("/?<\/table>$/i", "</table>", $strIn);
preg_match_all("/<TABLE.?>?(<\/TABLE>)/i", $strIn, $arrMatch);
echo '<BR>Number of matches: ' . count($arrMatch);
The above snippet is from my application that is attempting to parse a file for the tables that are within it.
It has three issues that I know of.
1 - The coding upto the first <table> tag does not get removed.
2 - The coding after the last </table> tag does not get removed.
3 - The most important issue is that $arrMatch does not contain the contents of the match.
I believe my problems are related to the regx. Any help would be most extremely welcome.
Thank you
Shaun