I just wanted a very basic PHP script to combine all my JS files into one – no minification, just bring them together into one file.
<?php // compress the file using GZIP ob_start("ob_gzhandler"); // javascript content-type header('Content-type: text/javascript'); // define the files you want to combine $files = array('jquery.js', 'app.js', 'somePlugin.js'); // combine the files foreach($files as $file) { // get the contents of this file $content .= file_get_contents($file) . ' '; //add a new line } // output the contents echo $content; ?>