dismiss Step into the future! Click here to switch to the beta php.net site
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Installing/Configuring> <Output Control
[edit] Last updated: Fri, 28 Jun 2013

view this page in

Introduction

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.

Note:

When upgrading from PHP 4.1.x (and 4.2.x) to 4.3.x due to a bug in earlier versions you must ensure that implicit_flush is OFF in your php.ini, otherwise any output with ob_start() will not be hidden from output.



add a note add a note User Contributed Notes Introduction - [1 notes]
up
0
Patrick
4 years ago
[In English:]
it's seem have performance impact, try this with and without bufferisation ( by output_buffering = 4096, or ob_start + ob_end_flush, it looks similar)

[En Francais:]
Ca semble avoir un fort impact sur les performances aussi, essayez ca avec et sans bufferisation ( par output_buffering = 4096, ou bien ob_start + ob_end_flush, ca semble identique)

<?php
for ($j=1; $j <= 5; $j++)  {

  list(
$usec, $sec) = explode(" ",microtime());
 
$debut[$j] = ((float)$usec + (float)$sec);

  echo
str_repeat("0123456789",5000) . '<br>' ;

  list(
$usec, $sec) = explode(" ",microtime());
 
$fin[$j] = ((float)$usec + (float)$sec);
}

for (
$j=1; $j <= 5; $j++)  {
   echo
round($fin[$j]-$debut[$j], 5) . '<br>';
}
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites