2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2002-10-18 14:39:35 +00:00
|
|
|
<!-- $Revision: 1.8 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<reference id="ref.outcontrol">
|
|
|
|
<title>Output Control Functions</title>
|
|
|
|
<titleabbrev>Output Control</titleabbrev>
|
|
|
|
|
|
|
|
<partintro>
|
2002-08-01 23:05:10 +00:00
|
|
|
<section id="outcontrol.intro">
|
|
|
|
&reftitle.intro;
|
|
|
|
<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>
|
|
|
|
</section>
|
|
|
|
|
2002-08-09 10:26:12 +00:00
|
|
|
<section id="outcontrol.requirements">
|
2002-08-01 23:05:10 +00:00
|
|
|
&reftitle.required;
|
|
|
|
&no.requirement;
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="outcontrol.installation">
|
|
|
|
&reftitle.install;
|
|
|
|
&no.install;
|
|
|
|
</section>
|
|
|
|
|
2002-09-16 20:46:37 +00:00
|
|
|
&reference.outcontrol.ini;
|
2002-08-01 23:05:10 +00:00
|
|
|
|
|
|
|
<section id="outcontrol.resources">
|
|
|
|
&reftitle.resources;
|
|
|
|
&no.resource;
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="outcontrol.constants">
|
|
|
|
&reftitle.constants;
|
|
|
|
&no.constants;
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="outcontrol.examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Output Control example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
echo "Hello\n";
|
|
|
|
|
|
|
|
setcookie ("cookiename", "cookiedata");
|
|
|
|
|
|
|
|
ob_end_flush();
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
2002-08-01 23:05:10 +00:00
|
|
|
</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>
|
2002-10-03 02:47:43 +00:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
When upgrading from PHP 4.1 (& 4.2) to 4.3 that due to a bug in
|
|
|
|
earlier versions you must ensure that
|
|
|
|
<literal>implict_flush</literal> is <literal>OFF</literal> in
|
|
|
|
your <literal>php.ini</literal>, otherwise any output with
|
|
|
|
<function>ob_start</function> will be not be hidden from output.
|
|
|
|
</para>
|
|
|
|
</note>
|
2002-08-01 23:05:10 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="outcontrol.seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
2002-10-18 14:39:35 +00:00
|
|
|
See also <function>header</function> and
|
2002-10-18 14:36:22 +00:00
|
|
|
<function>setcookie</function>.
|
2002-08-01 23:05:10 +00:00
|
|
|
</para>
|
|
|
|
</section>
|
2002-04-15 00:12:54 +00:00
|
|
|
</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
|
|
|
|
-->
|
|
|
|
|