reference/outcontrol/functions/ob-end-clean.xml
86b976d5afaf037868174fe5c242e886eb69baa4
...
...
@@ -3,7 +3,7 @@
3
3
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ob-end-clean">
4
4
<refnamediv>
5
5
<refname>ob_end_clean</refname>
6
-
<refpurpose>Clean (erase) the output buffer and turn off output buffering</refpurpose>
6
+
<refpurpose>Clean (erase) the contents of the active output buffer and turn it off</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
...
...
@@ -13,19 +13,23 @@
13
13
<void/>
14
14
</methodsynopsis>
15
15
<para>
16
-
This function discards the contents of the topmost output buffer and turns
17
-
off this output buffering. If you want to further process the buffer's
18
-
contents you have to call <function>ob_get_contents</function> before
19
-
<function>ob_end_clean</function> as the buffer contents are discarded
20
-
when <function>ob_end_clean</function> is called.
16
+
This function calls the output handler
17
+
(with the <constant>PHP_OUTPUT_HANDLER_CLEAN</constant> and
18
+
<constant>PHP_OUTPUT_HANDLER_FINAL</constant> flags),
19
+
discards it's return value,
20
+
discards the contents of the active output buffer
21
+
and turns off the active output buffer.
21
22
</para>
22
23
<para>
23
-
The output buffer must be started by
24
-
<function>ob_start</function> with <link
25
-
linkend="constant.php-output-handler-cleanable">PHP_OUTPUT_HANDLER_CLEANABLE</link>
26
-
and <link
27
-
linkend="constant.php-output-handler-removable">PHP_OUTPUT_HANDLER_REMOVABLE</link>
28
-
flags. Otherwise <function>ob_end_clean</function> will not work.
24
+
<function>ob_end_clean</function> will fail
25
+
without an active output buffer started with the
26
+
<constant>PHP_OUTPUT_HANDLER_REMOVABLE</constant> flag.
27
+
</para>
28
+
<para>
29
+
<function>ob_end_clean</function>
30
+
will discard the contents of the active output buffer
31
+
even if it was started without the
32
+
<constant>PHP_OUTPUT_HANDLER_CLEANABLE</constant> flag.
29
33
</para>
30
34
</refsect1>
31
35

...
...
@@ -37,9 +41,7 @@
37
41
<refsect1 role="returnvalues">
38
42
&reftitle.returnvalues;
39
43
<para>
40
-
&return.success; Reasons for failure are first that you called the
41
-
function without an active buffer or that for some reason a buffer could
42
-
not be deleted (possible for special buffer).
44
+
&return.success;
43
45
</para>
44
46
</refsect1>
45
47

...
...
@@ -53,7 +55,8 @@
53
55
<refsect1 role="examples">
54
56
&reftitle.examples;
55
57
<para>
56
-
The following example shows an easy way to get rid of all output buffers:
58
+
The following example shows an easy way to get rid of
59
+
the contents of the active output buffer:
57
60
</para>
58
61
<para>
59
62
<example>
...
...
@@ -77,13 +80,14 @@ ob_end_clean();
77
80
<simplelist>
78
81
<member><function>ob_start</function></member>
79
82
<member><function>ob_get_contents</function></member>
80
-
<member><function>ob_flush</function></member>
83
+
<member><function>ob_clean</function></member>
84
+
<member><function>ob_get_clean</function></member>
85
+
<member><function>ob_end_flush</function></member>
81
86
</simplelist>
82
87
</para>
83
88
</refsect1>
84
89

85
90
</refentry>
86
-

87
91
<!-- Keep this comment at the end of the file
88
92
Local variables:
89
93
mode: sgml
90
94