View Single Post
Old 01-12-2013, 06:13 PM   PM User | #3
kbluhm
Senior Coder

 
kbluhm's Avatar
 
Join Date: Apr 2007
Location: Philadelphia, PA, USA
Posts: 1,502
Thanks: 2
Thanked 258 Times in 254 Posts
kbluhm will become famous soon enough
Quote:
Originally Posted by tempz View Post
try this:

Code:
    $('*').contents().each(function() {
        if(this.nodeType == 8) {
            $(this).remove()
        }
    });
The OP specifically emphasized wanting a PHP solution.

This will strip all comments, but exclude thise that begin with <!--[
PHP Code:
$html preg_replace'/\<\!\-\-[^\[].*\-\-\>/Us'''$html ); 
__________________
ZCE

Last edited by kbluhm; 01-12-2013 at 06:33 PM..
kbluhm is offline   Reply With Quote
Users who have thanked kbluhm for this post:
JAG (01-15-2013)