PHP code example of deruli / html-minifier

1. Go to this page and download the library: Download deruli/html-minifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deruli / html-minifier example snippets



zz\Html\HTMLMinify;

$html = '<div>
    <p>
        text
    </p> 
</div>';

// shortcut. retrun minify html
$minify = HTMLMinify::minify($html);

// detail
$HTMLMinify = new HTMLMinify($html);
$minify = $HTMLMinify->process();
sh
curl -sS https://getcomposer.org/installer | php
php composer.phar install