Use PHP to control the use of the user's browser-ob * function. Using PHP to control the user's browser -- ob * function using OutputControl function allows you to freely control the data output in the script. It is very useful, especially for: when
Functions commonly used in OB series functions
Ob_start (); Open an output buffer, and all output information is not sent directly to the browser, but is stored in the output buffer.
Ob_clean (); Deletes the contents of the internal buffer without
function | control | browser uses PHP to control user's browser--ob* function
The output control function gives you a free rein in the outputs of the data in the script. It's very useful, especially for: when you want to output the file header after
Use PHP's Ob_start ();Control your browser cacheThe output control function gives you the freedom to control the outputs of the data in your script. It is very useful, especially when you want to output a file header after the data has been output.
Recently I have been familiar with some principles of php running. generally, php calls the template file through the controller to display the page. at the same time, some variable values in the controller will also be assigned to the template file,
Introduction of related functions:1, Flush: Flush the contents of the buffer, output.function format: Flush ()Description: This function is often used and is highly efficient.2. Ob_start: Open Output bufferfunction format: void Ob_start (void)Note:
The following tests the OB cache and the program cache:Before testing, we turned off the OB cache and set an obvious error level in the php.ini to test the results more clearly.
Output_buffering=offDisplay_errors=on
Code 1:
Copy Code code as
The output control function gives you the freedom to control the outputs of the data in your script. It is very useful, especially when you want to output a file header after the data has been output. The output control function does not affect the
This article is a blog post translated from Julien Pauli php output buffer in Deep,julien is a senior developer and maintainer of PHP source code. This article explains the output buffers in PHP and how to use them in several ways. The output
As you know, there is a layer in PHP called the output buffer. This article is to explain what it really is? How does PHP internally implement it? And how do I use it in a PHP program? This layer is not complex, but it is often misunderstood, and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.