Buffer is a memory address space, and the default size of the Linux system is generally 4096 (1KB), that is, a memory page.It is mainly used to store areas where data are transmitted between devices with asynchronous speed or between different devices with different priority.Through buffer, the mutual waiting of the process can be reduced.Here that a popular example of the point, when you open a text editor to edit a file, every time you enter a character, operating system does not immediately put this character directly written to the disk, but the first to write to buffer, when filled with a buffer to buffer, the data is written in of course, when the disk, calling a kernel function (flush) was forced to put the dirty data in buffer writ十回磁盘。 以同样的方式,当回波,打印时,输出不是立即通过TCP的客户端浏览器,但写入PHP缓存,PHP output_buffering机制意味着一个新的队列已经在TCP缓冲设置,和数据必须通过队列。当PHP缓存是满的,剧本的过程将输出发送数据从PHP缓存系统内核并将其发送到浏览器的浏览器显示它。所以,数据依次写这几个地方的回声/弹簧-> PHP缓存-> TCP ->缓存浏览器
3.ob_end_flush and ob_end_clean 这两个功能有点相似,他们都关掉ouptu_buffering机制。但不同的是,ob_end_flush只是将数据从PHP缓冲客户浏览器,而ob_clean_clean清空数据在PHP bufeer(擦除),但它不发送到客户端浏览器。同花顺发送是PHP。