This article mainly introduces the PHP method of using the cached instant output content (outputbuffering). The example analyzes the usage skills of php Cache output, which has some reference value, for more information about how to use PHP to cache output buffering. Share it with you for your reference. The details are as follows:
$ Buffer = ini_get ('output _ buffering '); echo str_repeat ('', $ buffer + 1); // prevents browser cache ob_end_flush (); // Disable Cache for ($ I = 1; $ I <= 10; $ I ++) {echo 'quarter '. $ I. 'Second output. '."
\ N "; flush (); // refresh the cache (directly sent to the browser) sleep (1);} echo 'output is complete! ';
The running effect is as follows:
Output 1st times.
Output 2nd times.
Output 3rd times.
Output 4th times.
Output 5th times.
Output 6th times.
Output 7th times.
Output 8th times.
Output 9th times.
Output 10th times.
Output complete!
I hope this article will help you with php programming.