How to use Ob_flush () and flush () for PHP
Note: the Ob_flush () and flush () functions are generally used together, in order to Ob_flush () first, then flush (), and their function is to flush the buffer.Here's a specific next time to use the
How to use Ob_flush () and flush () for PHP
Note: the Ob_flush () and flush () functions are generally used together, in order to Ob_flush () first, then flush (), and their function is to flush the buffer.Here's a specific next time to use the
* SessionFlush:
* The session flush method mainly involves two tasks:
Clear temporary records
Execute SQL
* When is the session flush?
By default, when a transaction is committed (commit)
Display call flush
Before executing a query, for example,
Python standard library: built-in function print (* objects, sep = '', end = '\ n', file = sys. stdout, flush = False), pythonsys. stdout
This function is used to format and output an object in a string representation to a stream file object file.
This function is the implementation of the object in a string representation of the format output to The stream file object files . where all non-keyword parameters are converted to string output by str () , the keyword parameter Sep is the
For the hibernate problem that my colleague met yesterday. Hibernate is the most basic thing. Know, this problem many people have met, also very common, but encountered also often will be ignorant. In order to deepen the impression, know it, know
Note: Ob_flush () and flush () These two functions are generally used together, in order to Ob_flush () first, then flush (), and their function is to flush the buffer. Here's a specific next time to use the flush buffer and why to flush the buffer.
Differences between flush and ob_flush in php (2011-11-11:3) protocol phpflushob_flush differences Miscellaneous: PHPbuffer ---- flush () buffer is a memory address space, in Linux, the default size is generally 4096 (1 kb), that is, a memory page.
My basic environment is nginx1.6.2+php5.3.To do a line-by-row output, the use of Ob_flush to try the N method does not work, such as the following code:
Ob_start ();for (;;){echo " ...";Ob_flush ();Flush ();Sleep (1);}?>
Google a lot of writing is
for ($i =10; $i >0; $i-) { echo $i; Flush (); sleep (1); } ?> according to the PHP manual This function sends all output from the current program to the user's browser. The above code, should be output once every second $i. But this is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.