php-doc-en/reference/outcontrol/reference.xml

75 lines
1.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<reference id="ref.outcontrol">
<title>Output Control Functions</title>
<titleabbrev>Output Control</titleabbrev>
<partintro>
<para>
The Output Control functions allow you to control when output is
sent from the script. This can be useful in several different
situations, especially if you need to send headers to the browser
after your script has began outputting data. The Output Control
functions do not affect headers sent using
<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>Output Control example</title>
<programlisting role="php">
<![CDATA[
<?php
ob_start();
echo "Hello\n";
setcookie ("cookiename", "cookiedata");
ob_end_flush();
?>
]]>
</programlisting>
</example>
</para>
<para>
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>
&reference.outcontrol.functions;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->