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
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|