reference/outcontrol/functions/flush.xml
91ab4f5f898023b0eed0e642e1482ac11f749d20
...
...
@@ -13,40 +13,38 @@
13
13
<void/>
14
14
</methodsynopsis>
15
15
<para>
16
-
Flushes the system write buffers of PHP and whatever backend PHP is using (CGI,
17
-
a web server, etc). This attempts to push current output all the way to
18
-
the browser with a few caveats.
19
-
</para>
20
-
<para>
21
-
<function>flush</function> may not be able to override the buffering scheme
22
-
of your web server and it has no effect on any client-side buffering in the
23
-
browser. It also doesn't affect PHP's userspace output buffering mechanism.
24
-
This means you will have to call both <function>ob_flush</function> and
25
-
<function>flush</function> to flush the ob output buffers if you are using
26
-
those.
27
-
</para>
28
-
<para>
29
-
Several servers, especially on Win32, will still buffer the output from
30
-
your script until it terminates before transmitting the results to the
31
-
browser.
32
-
</para>
33
-
<para>
34
-
Server modules for Apache like mod_gzip may do buffering of their own that
35
-
will cause <function>flush</function> to not result in data being sent
36
-
immediately to the client.
37
-
</para>
38
-
<para>
39
-
Even the browser may buffer its input before displaying it. Netscape, for
40
-
example, buffers text until it receives an end-of-line or the beginning of
41
-
a tag, and it won't render tables until the &lt;/table&gt; tag of the
42
-
outermost table is seen.
43
-
</para>
44
-
<para>
45
-
Some versions of Microsoft Internet Explorer will only start to display
46
-
the page after they have received 256 bytes of output, so you may need to
47
-
send extra whitespace before flushing to get those browsers to display the
48
-
page.
16
+
Flushes the system write buffers of PHP and the backend used by PHP
17
+
(e.g.: CGI, a web server).
18
+
In a command line environment <function>flush</function>
19
+
will attempt to flush the contents of the buffers only
20
+
whereas in a web context headers and the contents of the buffers are flushed.
49
21
</para>
22
+
<note>
23
+
<simpara>
24
+
<function>flush</function> may not be able to override
25
+
the buffering scheme of the web server
26
+
and it has no effect on any client-side buffering in the browser.
27
+
</simpara>
28
+
</note>
29
+
<note>
30
+
<simpara>
31
+
This function does not have any effect on user level output handlers
32
+
such as those started by <function>ob_start</function>
33
+
or <function>output_add_rewrite_var</function>.
34
+
</simpara>
35
+
</note>
36
+
<warning>
37
+
<simpara>
38
+
<function>flush</function> can interfere with output handlers
39
+
that set and send headers in a web context (e.g. <function>ob_gzhandler</function>)
40
+
by sending headers before these handlers can do so.
41
+
</simpara>
42
+
</warning>
43
+
</refsect1>
44
+

45
+
<refsect1 role="parameters">
46
+
&reftitle.parameters;
47
+
&no.function.parameters;
50
48
</refsect1>
51
49

52
50
<refsect1 role="returnvalues">
53
51