Before using ob_flush (), make sure that the preceding content is 4069 characters in size. The output_buffering of some Web servers is 4069 characters or larger by default, that is, the output content must reach 4069 characters before the server will flush refresh the output buffer. To ensure that flush is effective
Php tutorial ob_flush flush output cache instance and description
*/
Ob_flush ();
//
Flush ();
//
Function flush (){
Echo (str_repeat (''', 256 ));
// Check that buffer is actually set before flushing
If (ob_get_length ()){
@ Ob_flush ();
@ Flush ();
@ Ob_end_flush ();
}
@ Ob_start ();
}
// Str_repeat (string, repeat) repeat the specified number of times.
// Instance 2
@ Apache_setenv ('no-gzip ', 1 );
@ Ini_set ('zlib. output_compression ', 0 );
@ Ini_set ('implicit _ flush ', 1 );
For ($ I = 0; $ I <ob_get_level (); $ I ++) {ob_end_flush ();}
Ob_implicit_flush (1 );
/*
Note:
The use of flush and ob_flush is especially prone to errors, resulting in the failure to refresh the output buffer.
1. the correct order of flush and ob_flush should be: First ob_flush and then flush, as shown below:
Reference content is as follows:
Ob_flush ();
Flush ();
If the operating system of the web server is windows, the order is reversed or the ob_flush () is not used. However, in linux, the output buffer cannot be refreshed.
2. Before using ob_flush (), make sure that the preceding content is 4069 characters long enough.
The output_buffering of some web servers is 4069 characters or larger by default, that is, the output content must reach 4069 characters before the server will flush refresh the output buffer. To ensure that flush is effective