PHP4 new Function Introduction-Output information control function, previously forwarded by others _php tutorial

Source: Internet
Author: User
Tags setcookie
Introduction to the new function of PHP4-output information control function Demon Elves These functions allow you to control the content of your script output. It can be used in many different situations, especially if your script has output information that requires a new file header to be sent. The output control function does not affect the header information that is sent with the header () or Setcookie (), only for those data blocks that resemble Echo () and PHP code. Example 1. Control output In the example above, the output using echo () will be saved in the output buffer until Ob_end_flush () is called. What makes sense is that the content of the call to Setcookie () is successfully stored in the cookie without causing an error. (Under normal circumstances, you can not send the file header information to the user's browser after the data has been sent.) The associated function header () and Setcookie (). Korean list flush-The contents of the output buffer that are stored in the buffer are sent to the browser ob_start-open the output buffer so that all output information is not sent directly to the browser, but instead is stored in the output buffer ob_get_contents-return the contents of the output buffer If you want to process the output later, you can call this function to keep a backup ob_get_length-return the content length of the output buffer ob_end_flush-end (send) the contents of the output buffer, close the output buffer ob_end_clean- Delete (discard) The contents of the output buffer, turn off the output buffer if your program discovers that the output is problematic, you can discard all output and prevent some secret information from leaking ob_implicit_flush-open or close the direct flush opens, each script output is sent directly to the browser, You no longer need to call flush (),

http://www.bkjia.com/PHPjc/531735.html www.bkjia.com true http://www.bkjia.com/PHPjc/531735.html techarticle Introduction to new functions of PHP4-Output information control function Demon Elves These functions allow you to control the content of your script output. Can be used in many different situations, especially in your script ...

  • 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.