Output buffering ob_get_clean not working

I have the code below the code that works correctly the way I want. It does not send any output in the browser that I definitely want.

ob_start();
echo "test";
echo "test";
$output = ob_get_clean( );

But the problem is in my lower code. below the code to start sending output in the browser, even at the $output = ob_get_clean( );end

ob_start();
for($i=0;$i<=10000000;$i++){
    echo $i."<br/>";
}
$output = ob_get_clean( );

I can not understand the concept of output buffering. everyone says that you can control the output and send the output whenever you want, but my above script start sending the output to the browser.

+4
source share
1 answer

, 4 , script. , php.ini, . PHP

, ".". - "." (, output_buffering = 4096). PHP 4.3.5, PHP-CLI.

PHP- , , :

Streaming and Output Buffering

+4
source

Source: https://habr.com/ru/post/1689375/


All Articles