Home >Backend Development >PHP Tutorial > php的ob_flush跟flush

php的ob_flush跟flush

WBOY
WBOYOriginal
2016-06-13 13:23:52727browse

php的ob_flush和flush

php.ini中
output_buffering = off   关闭php的缓存
implicit_flush = Off     php不会立即输出到浏览器。如果是ON,相当于每次ECHO 立刻执行一个FLUSH

output_buffering 相当于一层缓冲。还有一层缓冲是php与浏览器之间的。ob_flush函数相当于把php缓冲写入php如浏览器输出层那个缓冲,当然如果output_buffering=off的话,也就是相当于没有php缓冲,直接就写入了php与浏览器缓冲。flush函数是把php输出层缓冲立即给浏览器,输出在浏览器上。

output_buffering=off 相当于每次echo 都执行了一次ob_flush。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn