除了某个div之外,如何压缩HTML输出?

I'd like to use this function:

ob_start('no_returns');
 function no_returns($a) { 
  return str_replace(
   array("
","","
","\t",'','',''), 
   '', $a);
 }

But when I do, it completely kills Disqus comments so I'd like to ignore the DIV "disqus_thread". How would I go about doing that without using some heavy search?

If you are looking to speed up the download of the web page, you might try another method:

<?php

ob_start('ob_gzhandler');
// html code here

This will compress the output in a much more efficient manner and your browser will automatically decompress the output in real-time before the visitor sees it.

A related thread on-line is here: http://bytes.com/topic/php/answers/621308-compress-html-output-php

(This is the PHP way to compress web pages without using the webserver configuration. For example apache+gzip/mod_deflate on apache as mentioned above)