mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
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:
parent
cee95e7fdc
commit
266d05653e
1 changed files with 23 additions and 3 deletions
|
@ -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">
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
echo "Hello\n";
|
||||
|
||||
setcookie("cookiename", "cookiedata");
|
||||
|
||||
ob_end_flush();
|
||||
|
||||
?>
|
||||
</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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue