Usage of the phpob_start () cache function

Source: Internet
Author: User
Usage of the phpob_start () cache function
This article introduces the usage of the ob_start () function used for cache control in php. For more information, see.

In php, the ob_start () function is used to open the buffer. for example, if there is output before the header () function, there will be "Header had all ready send by" errors in carriage return, space, or line feed.

In this case, you can use ob_start () to open the data block of the php code in the buffer zone and echo () to output the data in the buffer zone rather than immediately.

For methods to open the buffer in php, there are four methods: 1, used before header ()

     

2. the phpinfo () function can obtain client and server information and save client information in a buffer zone.

     

3. static page Technology

      

4. output code

     

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.