|
|
|
|
Like this code?
Show the author your appreciation.
|
|
| |
This is a little trick to compress PHP files when transmitted from web server into web browser using standard PHP functions. This method will save bandwidth and increase your web speed.
First method, using zlib extension.
You can only do this if your web server support zlib extention.
|
<?php
ini_set('zlib.output_compression',1);
ini_set('zlib.output_compression_level',9);
/* start your script below */
?> | |
Second method, using ob_start() function. Call ob_start() function with ob_gzhandler will compress the output. Just call this function on the top of every script you have.
| <?php
ob_start('ob_gzhandler');
/* put any code below */
?> | |
If you're curious, try it using Firebug and you will see how amazing this trick is. |
|
| PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | HTTP gzip compression Categories : PHP, PHP Classes, Compression, Zlib | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | phpEasyMail: An easy way to send data from HTML-forms via EMail. Categories : Email, HTML and PHP, Complete Programs, PHP | | | Vote-Poll script that has a wrapper class that allows the user to create
multiple polls on the same page with little trouble. Categories : PHP, PHP Classes, HTML and PHP | | | PHP function which gets all the data from a webpage into a string, we can perform regular expression functions on that data afterwards to get our desired data.
Categories : PHP, URLs, HTML and PHP | | | Remote Archive (Zip, Tar, Gzip) downloader with FTP and local extration support Categories : PHP, FTP, Filesystem, PHP Classes, Compression | | | GonxTabs : Create elegant HTML tabs based interface Categories : Navigation, HTML, HTML and PHP, PHP | | | Real simple example of removing HTML tags from text then changing \n (new line) to <br>. Could be used in a forum for instance. Categories : HTML, PHP, HTML and PHP, Beginner Guides | | | Validator 98 - a PHP-script to generate form-validation-code in JavaScript. Categories : Complete Programs, Java Script, PHP, HTML and PHP | | | Complex paging with no resultset limit Categories : PHP, MySQL, Databases, Output Control, HTML and PHP | | | Functions for loading images into a MySQL database and displaying them. Categories : Graphics, HTML and PHP, MySQL, PHP, Databases | | | Sql Builder Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing | | | phpFormGenerator for Dynamic Form Generation from MySQL Categories : PHP, PHP Classes, MySQL, Databases, HTML and PHP | | | Form Security - Match A Value For Success Categories : PHP, Authentication, HTML and PHP, Sessions, Security | |
| | | | Jason Hopkins wrote :1820
Please note that this code does not, in any way reduce the
file size of your PHP/HTML files. Instead, it compresses
the code sent to the browser using less bandwidth.
| |
|
|