The solution based on flush () cannot be output in sequence. In linux, first confirm whether to add ob_start () and ob_flush (). copy the code as follows: ob_start (); for ($ i1; $ i10; $ I ++) {echo $ I. brn; ob_flush (); flush (); usl in linux, first check whether ob_start () and ob_flush () are added ().
The code is as follows:
Ob_start ();
For ($ I = 1; $ I <= 10; $ I ++ ){
Echo $ I ."
\ N ";
Ob_flush ();
Flush ();
Usleep (500000 );
}
If the output is still unavailable, add the header information before the code.
The code is as follows:
Header ("Content-Type: text/html; charset = utf8 ;");
Ob_start ();
For ($ I = 1; $ I <= 10; $ I ++ ){
Echo $ I ."
\ N ";
Ob_flush ();
Flush ();
Usleep (500000 );
}
First, check whether ob_start () and ob_flush () are added (). the code is as follows: ob_start (); for ($ I = 1; $ I = 10; $ I ++) {echo $ I. "br/\ n"; ob_flush (); flush (); usl...