I know there is such an equivalent call in ASP.... something like response.flush or something. I am sure there has to be such a command in PHP. What is it?
Printable View
I know there is such an equivalent call in ASP.... something like response.flush or something. I am sure there has to be such a command in PHP. What is it?
do you mean flush()
http://uk2.php.net/flush
it will "flush" all of the output to the user.
You do need to start an ouput buffer first using the ob_start() function, as output buffering is turned off by default.
does ob_start() deffinatly need to be started, because i have used it without calling od_start()?
It seems that flush forces everything through, so it isn't required :blush:
If you want complete control, when and where the output is sent then you should use the output control functions provided by PHP.
Thanks guys. I realize that it isn't necessary, but I am generating a large web page with hundreds of links. They are generated as my script grinds through the hard drive. It would be nice to flush some information out to the user every so many links. So they don't have to wait for the whole page to be generated, ya know?
I don't know how often php is flushed out by itself. Does anyone know??
If you have not turned on output buffering, then the output is flushed by Apache, on a regular basis as it is generated. I am unsure at what size the buffer is but, when loading large pages the buffer is flushed often enough to give the appearance of a continual stream of data.