added example to partinfo

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@31231 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Beckham 2000-08-25 21:54:51 +00:00
parent cee95e7fdc
commit 266d05653e

View file

@ -9,18 +9,38 @@
situations, especially if you need to send headers to the browser
after your script has began outputing data. The Output Control
functions do not affect headers sent using
<function>header</function>, only functions such as
<function>echo</function> and data between blocks of PHP code.
<function>header</function> or <function>setcookie</function>,
only functions such as <function>echo</function> and data between
blocks of PHP code.
</para>
<para>
<example>
<title><function>Output Control</function> example</title>
<programlisting role="php">
&lt;?php
ob_start();
echo "Hello\n";
setcookie("cookiename", "cookiedata");
ob_end_flush();
?&gt;
</programlisting>
</example>
</para>
<para>
See also <function>header</function>.
In the above example, the output from <function>echo</function>
would be stored in the output buffer until
<function>ob_end_flush</function> was called. In the mean time,
the call to <function>setcookie</function> successfully stored a
cookie without causing an error. (You can not normally send
headers to the browser after data has already been sent.)
</para>
<para>
See also <function>header</function> and
<function>setcookie</function>.
</para>
</partintro>