All of us at one time connected to the Internet and wondered the beauty of the Internet traffic seen by the projects.
So once there was a desire to create something so big that all the internet surfers as much by what he saw gasped.
We sat at night staring at the monitor and make up, make up the html page, but none of us then did not even thought about the quality of layout, title page.
Only now penetrating into the problem of creating sites, we began to understand what to do westcom as simple as possible and so that our web projects quickly loaded, as not many have high speed Internet access.
After sitting a couple of days I tried to make a program that will be possible to optimize the quality html files.
To describe the quality of the program would like to say that the downloaded file from the Internet weighing 71 kV has been optimized using WebOptHtml_v_1.0 to 46.4 kV, I think it's about - it says.
- Removing comments from html files;
- Remove spaces inside html tags
- Erection of html tags to upper case;
- Remove blank lines in files;
- Remove tabs;
- Remove extra spaces.
The advantage of the program WebOptHtml_v_1.0 is that all the functions of processing files, you can easily customize to your taste and quality of on-demand optimization.
WebOptHtml_v_1.0 program is simply an attempt to reduce the weight of the html pages and increase the speed of their downloads.
How to work with the program:
First of all, create a directory file - file to be optimized, opt - optimized files.
To get started, you need to specify the files to be processed in the variable '$ array'.
Example of specifying a file: 1html, 2.html, 3.html. List of files given by a comma and no spaces.
I have implemented a graphical user interface and a list of files I have received from the form.
It is desirable to handle the number of files has been around less than 10.
Declare a class of OPT:
Call the main function of processing:
The parameter '$ type' specifies type of treatment - operator switch. Parameter has '$ type', I realized with the help of the form select.
If you want continued readability of html coding you need to remove the first line in the function nl2br_file (). Optimization of the files will be much better if you file, each block will be a blank line to separate:
That's all for today. Good luck in learning the beautiful language PHP.