Output Buffering
As stated above, the Web server buffers content sent to the browser, and you can request that the buffer be flushed. PHP4 introduced a new mechanism for buffering output you can control completely. Four functions control PHP's output buffer: ob_start, ob_end_flush, ob_end_clean, and ob_ get_contents. These are described in detail in Chapter 8, complete with examples, but I would like to give an overview here.
When you call the ob_start function, anything you send to the browser is placed into a buffer. This includes text outside of PHP tags. The Web server will not receive this content until the ob_end_flush function is called. There are several powerful applications of these functions. One is to avoid the problem associated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access