And that's about it. In this article, you learned a little bit about PHP's output control functions, using them to buffer the output of your script until you decide it's safe to display it to the user. You also learned how to erase the contents of the output buffer, retrieve the contents as a string for further processing, and apply user-defined callbacks to the buffer. Finally, this article demonstrated some applications of this technology in a real-world environment, using PHP's output control API to gracefully handle script errors and compress data sent to requesting clients to minimize download time. More information on the material discussed in this article can be found at: The PHP manual pages on output buffering, http://www.php.net/manual/en/ref.outcontrol.php A discussion of HTTP headers, http://www.garshol.priv.no/download/text/http-tut.html Till next time...stay healthy! Note: All examples in this article have been tested on Linux/i586 with Apache 1.3.20 and PHP 4.1.1. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!
blog comments powered by Disqus |