The output buffering commands add a layer of buffering controlled by PHP in addition to whatever buffering the Web server uses. Some performance penalty may be incurred by adding another layer of buffering, but you may decide the greater control you have is worth the price.
When ob_start is called, all output by functions such as print and echo are held back in a buffer, a large area of memory. The contents of the buffer may be sent to the browser using ob_end_flush, or it may be thrown away using ob_end_clean. Therefore, these functions allow you to avoid errors created by sending headers after content.
The ob_start function begins output buffering. All text sent by print and similar functions is saved in a buffer. It will not be sent to the browser until ob_end_flush is called. The buffer will also be flushed when the script ends.
The ob_end_flush function halts output buffering and sends the contents of the buffer to the browser.
The ob_end_clean function halts output buffering and eliminates the contents of the buffer. Nothing is sent to the browser.
The ob_get_contents function returns the contents of the output buffer.
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
An Introduction To Php
Variables, Operators, And Expressions
Classes And Objects
I/o And Disk Access
Time, Date, And Configuration Functions
Parsing And String Evaluation
Sorting Searching And Random Numbers
Integration With Html
Efficiency And Debugging
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.