| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 217 | All time: 8,299 This week: 560 | ||||
| Version | License | PHP version | Categories | |||
| code-minfier 1.0.3 | Free for non-comm... | 5 | PHP 5, Compression, Parsers |
| Description | Author | |
This class can minify HTML, JavaScript and CSS to take less space. |
Version: 0.1.5 beta
Github: https://github.com/marcocesarato/PHP-Minifier
Author: Marco Cesarato
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.
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;
| Method | Parameters | Description | | ----------- | ----------------------------------- | -------------------------------------------------- | | minifyJS | $javascript<br>return string | Minify Javascript | | minifyCSS | $css<br>return string | Minify CSS | | minifyHTML | $html<br>return string | Minify HTML |
| File | Role | Description |
|---|---|---|
| Lic. | License text | |
| Class | Class source | |
| Doc. | Documentation |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.