PHP code example of nodejs-php-fallback / uglify
1. Go to this page and download the library: Download nodejs-php-fallback/uglify 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/ */
nodejs-php-fallback / uglify example snippets
use NodejsPhpFallback\Uglify;
// Require the composer autoload in your PHP file if it's not already.
// You do not need to if you use a framework with composer like Symfony, Laravel, etc.
on.min.js');
// Output to the browser:
header('Content-type: text/javascript');
echo $uglify;
$uglify->jsMode();
echo $uglify; // display minified javascript
$uglify->cssMode();
echo $uglify; // display minified css
// or
echo $uglify->getMinifiedJs(); // display minified javascript
echo $uglify->getMinifiedCss(); // display minified css
composer
->write()