Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 203 | | All time: 8,306 This week: 306 |
|
Description | | Author |
This class can minify HTML, JavaScript and CSS to take less space.
It can take a string with either HTML, JavaScript or CSS, and parses it to eliminate unnecessary text.
The class returns as result a a string that is smaller than the original. | |
 |
|
Innovation award
 Nominee: 2x |
|
Details
PHP Minifier
Version: 0.1.5 beta
Github: https://github.com/marcocesarato/PHP-Minifier
Author: Marco Cesarato
Description
This class can minify HTML, JavaScript and CSS to take less space.
It can take a string with either HTML, JavaScript or CSS, and parses it to eliminate unnecessary text.
The class returns as result a a string that is smaller than the original.
Requirements
Install
Composer
-
Install composer
-
Type `composer require marcocesarato/minifier`
-
Enjoy
Usage
ob_start();
$html = <<<EOD
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
EOD;
echo $html;
$content = ob_get_contents();
ob_clean();
$minifier = new Minifier();
$min_html = $minifier->minifyHTML($content);
echo $min_html;
Methods
Minifier
| Method | Parameters | Description |
| ----------- | ----------------------------------- | -------------------------------------------------- |
| minifyJS | $javascript<br>return string | Minify Javascript |
| minifyCSS | $css<br>return string | Minify CSS |
| minifyHTML | $html<br>return string | Minify HTML |
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.