开发者

What does flush command do?

What do you mean by

"I w开发者_Go百科ould do it after you've sent everything to the client and flushed it."

ThankinG you


Flushing is the operation involved when there is buffering over streams of data.

Let's assume a normal stdout stream. Printing every byte as soon as it arrives would be inefficient, that's why output is usually buffered and 'flushed' out in chunks. This reduces the overhead of doing this kinds of operations.

So what that sentence means is that he would do it just when data has been prepared to be sent and already effectively sent by flushing the buffer out.

Usually this operation is transparent to the developer, you can force a flush but you don't explicitly need to do it.


flush prints out any buffered output to the client. everything you print out first goes into a buffer. you can also turn on explicit buffering if you want, so that nothing gets to the client but you can store it in the buffer for post editing of a website or something. flush ensures that everything in the buffer is sent to the client.


http://php.net/flush

Flushes the write buffers of PHP and whatever backend PHP is using (CGI, a web server, etc).


flush

Flush the output buffer

So in my read it means when you delivered the webpage to clients' browser.


This can mean a couple of different things, depending on the context. I'm assuming you mean flushing an outbut buffer.

An output buffer is where output is stored temporarily before being sent to a client all at once. Flushing means to send the stored data to the client. See the docs for ob_flush.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜