Forum Moderators: coopster
My regular expression is as follows
$content = htmlentities($string);
$pattern = "/(<table>)(.*)(<\/table>)/i";
if (preg_match($pattern, $content, $matches)) {
echo "A match was found.";
print_r ($matches);
} else {
echo "A match was not found.";
}
Thanks
$pattern = "/<table.*>\s*.*\s*<\/table>/i";
if (preg_match_all($pattern, $string, $matches)) {
$count = count($matches[0]);
for($i = 0; $i < $count; $i++)
{
echo "find ".($i+1).": ".$matches[0][$i]."<br>";
}
} else {
echo "A match was not found.";
}
Good luck!