Ec (2); I. Introduction: static pages are much faster than dynamic pages, for example, php. This is without a doubt, but due to the poor flexibility of static pages, if you do not use a database or other devices to save relevant information, the
Recently, you need to generate static PHP files you have written. After searching, you can find multiple methods. You can select different methods for different requirements.
Recently, you need to generate static PHP files you have written. After
The descriptions of ob_flushflush in the manual are to refresh the output buffer and must be used together, which may lead to confusion.
Ob_flush/flush descriptions in the manual are used to refresh the output buffer and must be used together, which
Ec (2); Use PHP's ob_start (); to control your browser cache! The OutputControl function allows you to control the output of data in the script. It is very useful, especially when you want to output the file header after the data has been output.
The output control function does not affect the header information sent using header () or setcookie (). It only applies to data blocks similar to echo () and PHP code.Let's take a simple example to give you a general impression on Output
Code for buffer control in PHP. When using PHP, you may need to use the header and setcookie functions. These two functions will send a file header to the browser, however, before using these two functions, you may need to use the header and
Recently, you need to generate static php files you have written. after searching, you can find multiple methods. you can select different methods for different requirements.
First: generate static php dynamic page content
The code is as
This article mainly introduces the usage of php buffer output, and analyzes the specific implementation process of buffer output in the form of instances. It has some reference value. If you need it, you can refer
This article mainly introduces the
Some information, such as constant, but still can be changed in the cache to speed up the display speed, which is very valuable, so-called cache, popular understanding is some of the information stored on the server side of the common. It is in the
The cache is widely used in practice, which can reduce the access to the server database and improve the running speed. At present, many CMS content management systems frequently use caching mechanism to improve the efficiency of system operation.
The output control function does not affect the header information sent when header () or setcookie () is used. It only applies
Code .
Let's take a simple example to give you a general impression on Output Control:Example 1.PHP codeCopy codeThe
Summary: many friends are confused about the traditional and simplified versions of the website. how can this problem be achieved? This is also a very important point missed in many PHP books. I collected and sorted out some key points and questions
For PHP static page template generation + cache + file writing, refer to the code below. 1. Introduction
In terms of speed, static pages are much faster than dynamic pages, for example, php. this is without a doubt, but due to the poor flexibility
Summary: this article briefly introduces the PHP output control function and provides specific ideas for its application in simplified and traditional Chinese conversion. Example 1: Introduction to the PHP output control function as one of the
Use PHP to generate static HTML code. For more information, see.
The Code is as follows:
Ob_start (); # enable server CacheInclude_once 'index. php ';$ Ctx = ob_get_contents (); # Get CacheOb_end_clean (); # Clear the cache$ Fh = fopen
PHP has many mechanisms and functions, which are actually magicians. if you repeat them to make good use of them, or even simple applications, they will have amazing results. Here is an ob_start () function. PHP has many mechanisms and functions,
Several buffer control functions are added to PHP4.0. using these functions can help us solve many problems. you can use the header and setcookie functions when using PHP, these two functions will send a file header to the browser, but if any output
Understand the difference between ob_flush and flush, ob_flushflush. A deep understanding of the differences between ob_flush and flush. the descriptions of ob_flushflushob_flushflush in the manual refresh the output buffer and need to be used
Note: I don't want to write it when I write it in half, so I am glad that the OutputControl function allows you to freely control the data output in the script. It is very useful, especially when you want to output the file header after the data has
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.