Re: gzip-based html compression
| From: | Zeev Suraski | Date: | Wed, 28 Jun 2000 18:28:09 +0000 |
| Subject: | Re: gzip-based html compression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3631@lists.php.net to get a copy of this message | ||
Output buffering is one of the nifty new features of PHP 4.0.
http://www.zend.com/phpfunc/o.html
http://www.zend.com/phpfunc/function.ob_start.html
http://www.zend.com/phpfunc/function.ob_end_clean.html
http://www.zend.com/phpfunc/function.ob_end_flush.html
http://www.zend.com/phpfunc/function.ob_get_contents.html
http://www.zend.com/phpfunc/function.ob_implicit_flush.html
Thanks to Hartmut for his great function reference!
Zeev
On Wed, 28 Jun 2000, Kevin Beckford wrote:
> Where can I find out more about these functions?? I checked the manual, and
> nothing is there...
> > You can do that pretty much transparently today(*), using the following
> > code:
> >
> > prepend.inc.php:
> > <?
> > ob_start();
> > header("Content-type: text/x-gzip-compressed"); // I don't really
> > remember what this line should really look like, this is just the general
> > idea
> > ?>
> >
> > append.inc.php:
> > <?
> > $content = ob_get_string();
> > ob_end_flush();
> > print gzcompress($content);
> > ?>
> >
> > Zeev
> >
> >
> > (*) Requires PHP 4.0
>
>
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/