Jump to content

PHP flush


n14charlie

Recommended Posts

<?php
ob_start();
for ($i = 1; $i <= 10; $i++) {
sleep(1);
echo "$i<br />";
ob_flush();
flush();
}
?>

This works for me in Firefox 3.0.10 and IE8, but it depends on the server settings (and browser).

 

yeah I just tested that script in Opera and doesn't work lol. Probably not Opera though, server settings I'm assuming like you said.

Link to comment
https://forums.phpfreaks.com/topic/159095-php-flush/#findComment-839002
Share on other sites

All of the web server, php, and browser compression, buffering, and minimum length block settings must must be satisfied, bypassed (flushed), or disabled.

 

If you are only going to be using this for yourself on your server, you have a chance of making it work. If you expect this to work once it is out of your hands, forget attempting to write an application this way, it is not how web servers and browsers were designed to work.

Link to comment
https://forums.phpfreaks.com/topic/159095-php-flush/#findComment-839004
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.