Home >Backend Development >PHP Tutorial >Introduction to new functions in PHP4 - Output information control function, forwarded by others before_PHP tutorial

Introduction to new functions in PHP4 - Output information control function, forwarded by others before_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:28:54917browse

Introduction to new functions in PHP4 - Output information control functions. These functions allow you to control the content output by your script. They can be used in many different situations, especially when you need to send a new file header after your script has output information. Situation. The output control function does not affect the file header information sent using header() or setcookie(), but only affects those data blocks similar to echo() and PHP code. Example 1. Control output above In the example, the output content using echo() will be stored in the output buffer until ob_end_flush() is called. What makes sense is that the content of the setcookie() call is successfully stored in the cookie without Causes an error. (Normally, you cannot send file header information to the user's browser after data has been sent.) Related functions header() and setcookie(). Korean list flush — Flushes the output buffer saved in the output The contents of the buffer will be sent to the browser ob_start — Opens the output buffer so that all output information is no longer sent directly to the browser, but is saved in the output buffer ob_get_contents — Returns the contents of the output buffer if you want to process the output later content, 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 content of the output buffer, close the output buffer ob_end_clean — delete (abandon) the content of the output buffer, close the output buffer If your program finds that there is a problem with the output content, you can discard all output content, which can prevent the leakage of certain secret information. ob_implicit_flush - Turn on or off direct flush. When turned on, each script output is sent directly to the browser, and there is no need to call flush. (),

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531735.htmlTechArticleIntroduction to new functions of PHP4 - Output information control function Demon Elf These functions allow you to control the output of your script Content. Can be used in many different situations, especially in your scripts...
Statement:
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