WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Reduce PHP/HTML File Sizes
Categories : PHP, Compression, HTML and PHP, Zlib
Yeni Setiawan
Date : Nov 05th 2008
Grade : 1 of 5 (graded 2 times)
Viewed : 4884
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Yeni Setiawan
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
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.



PHP4 HTTP Compression Speeds up the Web
Categories : PHP, Zlib, HTML and PHP, HTTP, Network
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
PHP, simple, counter, bala
Categories : HTML and PHP, PHP, PHP Options and Info
CALENDAR - easy calendar-navigation with PHP
Categories : PHP, Date Time, HTML and PHP, Calendar
html split bar used to split in multiple pages a database result
Categories : HTML and PHP, Databases, MySQL, PHP
Smart Counter - This little script is a plain and simple hit counter that uses cookies to determine whether or not the visitor has already been counted.
Categories : Cookies, HTML and PHP, PHP
Record Set Paging with PHP (RSP)
Categories : PHP, MySQL, Navigation, Databases, HTML and PHP
Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex codes for their text, background, and link colors, and preview the color scheme with their background image. Example: http://www.snipe.net/tech/snipeschool/hex.php3
Categories : PHP, HTML and PHP, General, Graphics, HTML
Parse html (title :: meta)
Categories : PHP, HTML and PHP, Regexps
PHP4 session helper HTML file.
Categories : PHP, Java Script, HTML and PHP, Sessions
Sed, a coder's best friend. This lovely linux command allows you to swap strings in a file. Great for changing a variable name in a script with multiple files.
Categories : HTML and PHP, HTML and PHP
Parse string to find sub-string between two arbitrary strings
Categories : PHP, Strings, HTML and PHP, Arrays
OverEasy - PHP generated JavaScript to do mouseovers on your pages. Modify one file and one function does it all for you!
Categories : PHP, Java Script, HTML and PHP, MySQL
Using Postgres and PHP3 Authentication from a Web application
Categories : PostgreSQL, HTML and PHP, Authentication, PHP
 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.