marcocesarato / minifier
This class can minify HTML, Javascript and CSS
Installs: 9 190
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 2
Open Issues: 1
Requires
- php: >=4.0.0
This package is auto-updated.
Last update: 2024-10-16 17:35:14 UTC
README
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
- php 4+
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;