uTools-Manuals/docs/php/flush.html
2019-04-28 19:00:34 +08:00

41 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>刷新输出缓冲</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.flush" class="refentry">
<div class="refnamediv">
<h1 class="refname">flush</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">flush</span> &mdash; <span class="dc-title">刷新输出缓冲</span></p>
</div>
<div class="refsect1 unknown-seealsp" id="refsect1-function.flush-unknown-seealsp">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>flush</strong></span>
( <span class="methodparam">void</span>
) : <span class="type"><span class="type void">void</span></span></div>
<p class="simpara">
刷新PHP程序的缓冲而不论PHP执行在何种情况下CGI web服务器等等。该函数将当前为止程序的所有输出发送到用户的浏览器。
</p>
<p class="para">
<span class="function"><strong>flush()</strong></span> 函数不会对服务器或客户端浏览器的缓存模式产生影响。因此,必须同时使用 <span class="function"><a href="ob_flush.html" class="function">ob_flush()</a></span><span class="function"><strong>flush()</strong></span> 函数来刷新输出缓冲。
</p>
<p class="para">
个别web服务器程序特别是Win32下的web服务器程序在发送结果到浏览器之前仍然会缓存脚本的输出直到程序结束为止。
</p>
<p class="para">
有些Apache的模块比如mod_gzip可能自己进行输出缓存这将导致<span class="function"><strong>flush()</strong></span>函数产生的结果不会立即被发送到客户端浏览器。
</p>
<p class="para">
甚至浏览器也会在显示之前,缓存接收到的内容。例如 Netscape 浏览器会在接受到换行或 html 标记的开头之前缓存内容,并且在接受到 &lt;/table&gt; 标记之前,不会显示出整个表格。
</p>
<p class="para">
一些版本的 Microsoft Internet Explorer 只有当接受到的256个字节以后才开始显示该页面所以必须发送一些额外的空格来让这些浏览器显示页面内容。
</p>
</div>
</div></div></div></body></html>