PHPWee - Minify HTML, HTML5, CSS and Javascript using PHP

Опубликовано: 25 Март 2015
на канале: SearchTurbine
7,007
31

PHPWee is an inline PHP minifier for web resources. It lets you minify HTML4, HTML5, XHTML, CSS and JavaScript files in a single line of code. http://searchturbine.com/php/phpwee

The best bit is its free and open source under the BSD license.









How to compress HTML:

$minified_html = PHPWee\Minify::html($any_html);

This automatically compresses all inline scripts and stylesheets within the HTML document. Apply a 'data-no-min' attribute to a script or style to exclude it from minification.

How to compress CSS:

$minified_css = PHPWee\Minify::css($any_css);
How to compress JS:

$minified_js = PHPWee\Minify::html($any_js);
Spelling out out:


require_once ("phpwee-php-minifier/phpwee.php");

$html = file_get_contents("http://searchturbine.com/");
$minified_html = PHPWee\Minify::html($html);
// a 9.38% performance boost - in 3 lines of code!!
There are working examples in the /examples folder of the package.


На этой странице сайта вы можете посмотреть видео онлайн PHPWee - Minify HTML, HTML5, CSS and Javascript using PHP длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SearchTurbine 25 Март 2015, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 7,007 раз и оно понравилось 31 зрителям. Приятного просмотра!