title: PHP Flush All Levels of Output Buffering
body: <p>I'm trying to implement a simple Http Response class that implements Http Streaming (or Chunked-Encoding).  For this to be possible, I need to set <code>output_buffering = Off</code> in the php.ini, and flush the output at certain intervals.  </p>
  
  <p>PHP does a good job of this automatically - except for the actual flushing mechanism.  I've gotten it to work, but I'm not sure if it's overboard.  I want to know how to flush each level of output buffering at once, without calling a billion functions (I'm not sure which ones are redundant on which environments / in which scenarios). </p>
  
  <pre><code>    while (ob_get_level())
      {
          ob_end_flush();
      }
  
      // print the buffer
  
      flush();
      ob_flush();
  </code></pre>
  
  <p>Is this overkill?  </p>