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,28 +13,35 @@
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

36
+
<refsect1 role="parameters">
37
+
&reftitle.parameters;
38
+
&no.function.parameters;
39
+
</refsect1>
40
+

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

...
...
@@ -48,7 +55,8 @@
48
55
<refsect1 role="examples">
49
56
&reftitle.examples;
50
57
<para>
51
-
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:
52
60
</para>
53
61
<para>
54
62
<example>
...
...
@@ -72,13 +80,14 @@ ob_end_clean();
72
80
<simplelist>
73
81
<member><function>ob_start</function></member>
74
82
<member><function>ob_get_contents</function></member>
75
-
<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>
76
86
</simplelist>
77
87
</para>
78
88
</refsect1>
79
89

80
90
</refentry>
81
-

82
91
<!-- Keep this comment at the end of the file
83
92
Local variables:
84
93
mode: sgml
85
94