Home > Backend Development > PHP Tutorial > Solution based on flush() that cannot be output in order_PHP tutorial

Solution based on flush() that cannot be output in order_PHP tutorial

WBOY
Release: 2016-07-21 15:02:22
Original
934 people have browsed it

If you are under Linux, first confirm whether to add ob_start() and ob_flush().

Copy the code The code is as follows:

ob_start();
for ($i=1; $i<=10; $i++) {
                 echo $i."
n"; >        flush(); >Copy code

The code is as follows:


header("Content-Type: text/html;charset=utf8;");
ob_start();
for ($i=1; $i<=10; $i++) {
                                                                                                                                      echo $i." usleep(500000);
}
http://www.bkjia.com/PHPjc/327921.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/327921.html

TechArticle
If it is under Linux, first confirm whether to add ob_start() and ob_flush(). Copy the code as follows: ob_start (); for ($i=1; $i=10; $i++) { echo $i."br /n"; ob_flush(); flush(); usl...

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template