Notes for using the PHP flush function and precautions for using the flush Function
Ob _ * series functions are used to operate the output buffer of PHP itself.
Therefore, ob_flush is used to refresh the PHP buffer.
But flush, strictly speaking,
In php, flush and header are both used to report errors. I have output before the header. how can I prevent the following code header from reporting errors? Find a solution ....
// This is the code I added
Echo 'SD ';
Ob_flush ();
Flush ();
//
Http://bbs.chinaunix.net/thread-1753130-1-1.htmlWhen a transaction commits, Innobase calls Innobase_commit in ha_innodb.cc, and Innobase_commit calls Trx_commit_complete_for_mysql (TRX0TRX.C) To call Log_write_up_to (LOG0LOG.C), that is, when
for ($i =10; $i >0; $i-) { echo $i; Flush (); sleep (1); } ?> according to the PHP manual This function sends all output from the current program to the user's browser. The above code, should be output once every second $i. But this is
Generally, Ajax is used to output HTML to the client, and then Ajax is used to load time-consuming resources. The trouble with Ajax is that it increases the number of requests and requires additional JavaScript code.
Code And the request interface
For ($ I = 10; $ I> 0; $ I --){Echo $ I;Flush ();Sleep (1 );}?>
According to the PHP Manual
This function sends all the output of the program so far to the user's browser.
The above code should output $ I every second. But not necessarily in
Teach you how to use the PHP function flush () correctly (). For the content just learned 1. Flush: refresh the buffer and output. Function format: flush () is a very efficient function in PHP3, which has a very
1. Flush: refresh the buffer content
For just Learning
1, Flush: Flush the contents of the buffer, output.function format: Flush ()
This function appears in PHP3, is a very efficient function, he has a very useful function is to refresh the browser cache. Let's take a very obvious
In general, we are dealing with this situation, using AJAX, first output HTML to the client, and then use AJAX to load more time-consuming resources. The trouble with Ajax is to increase the number of requests, and need to write additional JS code,
The usage and difference between flush () and ob_flush () and ob_end_flush () in php. This article will give you a summary of the usage and differences between flush (), ob_flush (), and ob_end_flush () in php. For more information, see the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.