How to use JS and CSS optimization tools Minify in PHP. To reduce HTTP requests, we often need to merge and compress multiple JS and CSS files, next we will record the PHP source code for implementing this function and the usage of Minify, an open-source project. I. to reduce HTTP requests, we often need to merge and compress multiple JS and CSS files, the following is a record of the PHP source code for implementing this function and the usage of Minify, an open-source project.
1. for code for merging and compressing multiple JS and CSS files, see
1. a command to quickly merge JS and CSS files
2. PHP merges multiple JS and CSS files to reduce HTTP requests (prototype)
II. usage of Minify
1. download the latest version of minifyfrom code.google.com/p/minify/and decompress it. copy the "min" folder along with the content to the DOCUMENT_ROOT Directory (website and directory ).
You can modify the folder name "min"
2. configure g parameters in "min/groupsConfig. php ".
Return array (
// 'Js' => array ('// js/file1.js',' // js/file2.js '),
// 'Css '=> array (' // css/file1.css ',' // css/file2.css '),
);
3. you can reference the web page as follows: