Output Control Functions
Output Control
&reftitle.intro;
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
header or setcookie,
only functions such as echo and data between
blocks of PHP code.
&reftitle.required;
&no.requirement;
&reftitle.install;
&no.install;
&reference.outcontrol.ini;
&reftitle.resources;
&no.resource;
&reftitle.constants;
&no.constants;
&reftitle.examples;
Output Control example
]]>
In the above example, the output from echo
would be stored in the output buffer until
ob_end_flush was called. In the mean time,
the call to setcookie successfully stored a
cookie without causing an error. (You can not normally send
headers to the browser after data has already been sent.)
When upgrading from PHP 4.1 (& 4.2) to 4.3 that due to a bug in
earlier versions you must ensure that
implict_flush is OFF in
your php.ini, otherwise any output with
ob_start will be not be hidden from output.
&reftitle.seealso;
See also header and
setcookie.
&reference.outcontrol.functions;