Discover output buffering in php with example, include the articles, news, trends, analysis and practical advice about output buffering in php with example on alibabacloud.com
In fact, for PHP programmers, almost every script involves an output buffer, but in most cases we don't need to change the output buffer. And today to use the example of the PHP output buffer control function "output controls" to do a detailed
This article mainly introduces the PHP output buffer introduction and the function, the interest friend's reference, hoped to be helpful to everybody.
Overview
Previously researched PHP input and output buffers, but after the blog moved, the
In PHP, when running Echo,print, the output is not immediately transmitted via TCP to the client browser, but instead writes the data to PHP buffer. The PHP output_buffering mechanism means that a new queue is established before the TCP buffer, and
Buffer
Buffer is a memory address space, the Linux system default size is generally 4096 (4KB), that is, a memory page. It is primarily used for data transfer between devices that are not synchronized at the storage speed or between devices with
Buffering (buffer) is a technique used to coordinate data transfer between devices with very different throughput speeds, and the area used to hold buffered data is called a buffer, and in computer science, a buffer is used to temporarily store data
Buffer
Buffer is a memory address space, the Linux system default size is generally 4096 (4KB), that is, a memory page. It is primarily used to store data between devices that are out of sync or between devices with different priority levels. By
Brief introduction
When the PHP script has output, the output control function can use these to control the output. This is useful in a number of different situations, especially when the script begins to output data and sends an HTTP header message
Let's look at a piece of code first:
〈?php
for ($i =10; $i 〉0; $i--)
{
echo $i;
Flush ();
Sleep (1);
}
?〉
According to the PHP manual, this function sends all output from the current program to the user's browser.
The above code, should be output
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.