hholzgra Tue Dec 27 21:12:53 2005 EDT
Modified files:
/phpdoc/en/reference/outcontrol/functions ob-get-contents.xml
ob-get-length.xml
Log:
added more examples
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml
diff -u phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml:1.2
phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml:1.3
--- phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml:1.2 Wed Apr
17 06:42:34 2002
+++ phpdoc/en/reference/outcontrol/functions/ob-get-contents.xml Tue Dec
27 21:12:53 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.5 -->
<refentry id="function.ob-get-contents">
<refnamediv>
@@ -15,8 +15,44 @@
<void/>
</methodsynopsis>
<para>
- This will return the contents of the output buffer or &false;, if
- output buffering isn't active.
+ This will return the contents of the output buffer without clearing it
+ or &false;, if output buffering isn't active.
+ </para>
+ <para>
+ <example>
+ <title>A simple <function>ob_get_contents</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+ob_start();
+
+echo "Hello ";
+
+$out1 = ob_get_contents();
+
+echo "World";
+
+$out2 = ob_get_contents();
+
+ob_end_clean();
+
+var_dump($out1, $out2);
+?>
+]]>
+ </programlisting>
+ <para>
+ Our example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+string(6) "Hello "
+string(11) "Hello World"
+
+]]>
+ </screen>
+ </example>
</para>
<para>
See also <function>ob_start</function> and
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/outcontrol/functions/ob-get-length.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/en/reference/outcontrol/functions/ob-get-length.xml
diff -u phpdoc/en/reference/outcontrol/functions/ob-get-length.xml:1.3
phpdoc/en/reference/outcontrol/functions/ob-get-length.xml:1.4
--- phpdoc/en/reference/outcontrol/functions/ob-get-length.xml:1.3 Sat Feb
8 12:10:05 2003
+++ phpdoc/en/reference/outcontrol/functions/ob-get-length.xml Tue Dec 27
21:12:53 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.22 -->
<refentry id="function.ob-get-length">
<refnamediv>
@@ -19,6 +19,41 @@
or &false;, if output buffering isn't active.
</para>
<para>
+ <example>
+ <title>A simple <function>ob_get_contents</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+ob_start();
+
+echo "Hello ";
+
+$len1 = ob_get_length();
+
+echo "World";
+
+$len2 = ob_get_length();
+
+ob_end_clean();
+
+echo $len1 . ", ." . $len2;
+?>
+]]>
+ </programlisting>
+ <para>
+ Our example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+6, 11
+
+]]>
+ </screen>
+ </example>
+ </para>
+ <para>
See also <function>ob_start</function> and
<function>ob_get_contents</function>.
</para>