Copyright statement: original works can be reproduced. During reprinting, be sure to mark them as hyperlinks.ArticleOriginal publication, author information, and this statement. Otherwise, legal liability will be held. Http://blog.csdn.net/mayongzhan-ma yongzhan, myz, mayongzhan
First Code
<? PHP
Header ("Content-Type: text/html; charset = UTF-8 ");
Ob_end_clean (); // modify part
For ($ I = 10; $ I> 0; $ I --)
{
Echo $ I;
Flush ();
Sleep (1 );
}
?>
This is to display a number per second. This is the basis. What we need to do is to simulate the installation progress.
Test other functions:
<? PHP
Header ("Content-Type: text/html; charset = UTF-8 ");
For ($ I = 1; $ I <10; $ I ++)
{
Echo $ I. "1 ~~~ <Br/> ";
Ob_flush (); // modify part
Echo $ I. "2 ~~~ <Br/> ";
Flush ();
Echo $ I. "3 ~~~ <Br/> ";
Sleep (5 );
Echo $ I. "4 ~~~ <Br/> ";
}
?>
Test the function. The first output is "1", then wait for 5 seconds, and then output the remaining
We can see that. ob_flush is a split point.
Ob_flush is used to fetch the cache...
Sleep is paused for 5 seconds.
Flush is the cache output.
The entire process is
Echo 1 (in cache now)
Ob_flush: Obtain the cache (1) and prepare the output.
Echo 2 (in cache now)
Flush outputs (1) obtained
Echo 3 (in cache now)
Sleep temporarily stops for 5 seconds
Echo 4 (in cache now)
Echo 1 (in cache now)
Ob_flush: cache (2341) (Please note that the order is the cache order) to prepare the output.
Echo 2 (in cache now)
Flush outputs (2341)
.................
Process continues...
I can see it clearly.
Install Program We can do this:
<? PHP
Header ("Content-Type: text/html; charset = UTF-8 ");
For ($ I = 1; $ I <10; $ I ++)
{
Echo "specific installation operations <br/> ";
Ob_flush (); // modify part
Flush ();
}
?>
In this way, common installation in Windows is implemented, and the effect of the process is displayed.