This article summarizes the implementation of web page compression and transmission using php ob_start (ob_gzhandler). Friends in need can refer to it.
Let’s first look at the usage of ob_start
Use the PHP ob_start() function to open the browser's cache. This ensures that the contents of the cache will not be output before you call flush(), ob_end_flush() (or the program is executed)
The code is as follows
|
Copy code
|
||||
phpinfo(); //Use phpinfo function $info=ob_get_contents(); //Get the contents of the buffer and assign it to $info $file=fopen(’info.txt’,’w’); //Open the file info.txt fwrite($file,$info); //Write information to info.txt fclose($file); //Close file info.txt ?>
Previous article:A simple php and mysql data paging program_PHP tutorial
Next article:Share a PHP code to implement infinite classification program_PHP tutorial
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
Latest Articles by Author
Latest Issues
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|