Hi,
This snippet of code removes HTML tags from a text string, but it doesn't remove comments when they contain the '>' character. Any ideas? Also, any suggestions that could speed it up would be greatly appreciated!
<CODE>
function RemoveHTML ($Text) {
//--- Removes basic HTML tags from the text
//--- First get rid of comments (to prevent indented tags)
$Text = ereg_replace ("\<!--([^>]*)--\>", " ", $Text);
//--- Then get rid of the HTML
$Text = ereg_replace ("\<([^>]*)\>", " ", $Text);
//--- Finally get rid of special characters
$Text = ereg_replace ("&#?[a-zA-Z0-9]+;", " ", $Text);
return $Text;
}
</CODE>
Thanks
-- John G.