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 example of how the PHP function flush () works.
Example 2.
- < ? PHP
- For ($i = 1; $i <= $i + +) print ("");
- This is a very important sentence, the structure of the cache
So that its content only reaches a certain size in order to output from the browser
- In other words, if the contents of the cache do not reach
A certain size, it is not output before the program finishes executing. By
- After testing, I found that the bottom of this size is
256 characters in length. This means that content received by the cache will be
- The stream was sent out.
- For ($J = 1; $j <= $j + +) {
- echo $j. "
- ”;
- Flush (); This will allow the cache to add new content
Be squeezed out and displayed on the browser
- Sleep (1); Let the program "Sleep" for a second, will let
You can see the effect more clearly.
- }
- ?>
PHP2000 's newest PHP chat room is the use of this technology, unfortunately, the source code is not disclosed. Note: If you add Ob_implicit_flush () to the program's header to open the absolute refresh, you can no longer use the PHP function flush () in the program, the advantage is: improve efficiency!
http://www.bkjia.com/PHPjc/446115.html www.bkjia.com true http://www.bkjia.com/PHPjc/446115.html techarticle 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 ...