Mitul Dabhi
answered Nov 30 '-1 00:00
there are many php script out there which help you to minify JavaScript
some Javascript Minifier what i used
=> JShrink
i try to use https://github.com/tedivm/JShrink but i get some error with php so i had changed it
you can get at
https://github.com/archirayan-infotech/minify-js
this way you can use it dynamically . it will take js file and minify on fly and use it direct on the page
$js=file_get_contents("dynamic.js");
include('Minifier.php');
// Basic (default) usage.
$minifiedCode = Minifier::minify($js);
// Disable YUI style comment preservation.
$minifiedCode = Minifier::minify($js, array('flaggedComments' => false));
=> JSMin
https://github.com/archirayan-infotech/JSMin
$js=file_get_contents("dynamic.js");
include("Jsmin.php");
$minified=JSMin::minify($js);