PHP - Output Control
The Output Control functions allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has begun outputting data. The Output Control functions do not affect headers sent using header() or setcookie(), only functions such as echo and data between blocks of PHP code.
There is no installation needed to use these functions. These functions are part of the PHP core.
PHP Output Control Functions
|ob_get_contents()||Returns the contents of the output buffer.|
|ob_get_length()||Returns the length of the output buffer.|
|ob_get_level()||Returns the nesting level of the output buffering mechanism.|
|ob_start()||Turns on output buffering.|
PHP Output Control Predefined Constants
The constants below are always available as part of the PHP core.
|PHP_OUTPUT_HANDLER_START||Integer||Indicates that output buffering has begun.|
|PHP_OUTPUT_HANDLER_WRITE||Integer||Indicates that the output buffer is being flushed, and had data to output.|
|PHP_OUTPUT_HANDLER_FLUSH||Integer||Indicates that the buffer has been flushed.|
|PHP_OUTPUT_HANDLER_CLEAN||Integer||Indicates that the output buffer has been cleaned.|
|PHP_OUTPUT_HANDLER_FINAL||Integer||Indicates that this is the final output buffering operation.|
|PHP_OUTPUT_HANDLER_CONT||Integer||Indicates that the buffer has been flushed, but output buffering will continue. This is an alias for PHP_OUTPUT_HANDLER_WRITE.|
|PHP_OUTPUT_HANDLER_END||Integer||Indicates that output buffering has ended. This is an alias for PHP_OUTPUT_HANDLER_FINAL.|
|PHP_OUTPUT_HANDLER_CLEANABLE||Integer||Controls whether an output buffer created by ob_start() can be cleaned.|
|PHP_OUTPUT_HANDLER_FLUSHABLE||Integer||Controls whether an output buffer created by ob_start() can be flushed.|
|PHP_OUTPUT_HANDLER_REMOVABLE||Integer||Controls whether an output buffer created by ob_start() can be removed before the end of the script.|
|PHP_OUTPUT_HANDLER_STDFLAGS||Integer||The default set of output buffer flags; currently equivalent to PHP_OUTPUT_HANDLER_CLEANABLE | PHP_OUTPUT_HANDLER_FLUSHABLE | PHP_OUTPUT_HANDLER_REMOVABLE.|