Hello,
Just having a problem with these, please can someone assist.
The function is to remove all html comments from in a page but ignore any
style or script blocks.
It looks like this works but I need it todo one more thing. There are some
comments I would like, so how can I make it ignore <!--- //--> but remove
<!-- //-->. Notice the additional (-)
function removeComments($text){
$search =
'/<(?:!(?:--[\s\S]*?--\s*)?(>)\s*|(?:script|style|SCRIPT|STYLE)[\s\S]*?<\/(?
:script|style|SCRIPT|STYLE)>)/';
return preg_replace($search, '', $text);
}
Thank you
Mark Dyer
NZ.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/