PHPackages                             taufik-nurrohman/minify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. taufik-nurrohman/minify

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

taufik-nurrohman/minify
=======================

Reduce CSS, HTML, JavaScript, JSON, PHP, and XML code size on the server side.

v1.0.5(5mo ago)310[1 issues](https://github.com/taufik-nurrohman/minify/issues)MITPHPPHP &gt;=7.1

Since Jan 9Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/taufik-nurrohman/minify)[ Packagist](https://packagist.org/packages/taufik-nurrohman/minify)[ Docs](https://github.com/taufik-nurrohman/minify)[ Fund](https://paypal.me/tatautaufik)[ RSS](/packages/taufik-nurrohman-minify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

PHP Minify
==========

[](#php-minify)

[![c-s-s.php](https://camo.githubusercontent.com/6585d63039c7c76ff089fd9ebd15395274a1fd725bf36f9ca79291188ab80f39/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f632d732d732e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d632d732d732e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6585d63039c7c76ff089fd9ebd15395274a1fd725bf36f9ca79291188ab80f39/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f632d732d732e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d632d732d732e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265) [![h-t-m-l.php](https://camo.githubusercontent.com/f9c050658345de4c514e05e00cd927c28767c3729309fa74c04aeefd385328fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f682d742d6d2d6c2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d682d742d6d2d6c2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f9c050658345de4c514e05e00cd927c28767c3729309fa74c04aeefd385328fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f682d742d6d2d6c2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d682d742d6d2d6c2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265) [![j-s.php](https://camo.githubusercontent.com/e955ed19754db65c5ee6cc194bd6f8ee2fc9dec36607cffb49482d9bfbafb6d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f6a2d732e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d6a2d732e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/e955ed19754db65c5ee6cc194bd6f8ee2fc9dec36607cffb49482d9bfbafb6d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f6a2d732e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d6a2d732e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265) [![j-s-o-n.php](https://camo.githubusercontent.com/0fbb85e3ea30d05244b0edc833f091966de1147dd46b4a830959db2450977dce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f6a2d732d6f2d6e2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d6a2d732d6f2d6e2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0fbb85e3ea30d05244b0edc833f091966de1147dd46b4a830959db2450977dce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f6a2d732d6f2d6e2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d6a2d732d6f2d6e2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265) [![p-h-p.php](https://camo.githubusercontent.com/979e1c6e66f3af18a574b96c969f19b22e5f3b22355c07ba205db8af77dd15a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f702d682d702e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d702d682d702e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/979e1c6e66f3af18a574b96c969f19b22e5f3b22355c07ba205db8af77dd15a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f702d682d702e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d702d682d702e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265) [![x-m-l.php](https://camo.githubusercontent.com/c4c88c4f75502d35144ec2f292238be4c4ef0c3460458d9bcd1845ed79df130e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f782d6d2d6c2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d782d6d2d6c2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c4c88c4f75502d35144ec2f292238be4c4ef0c3460458d9bcd1845ed79df130e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f74617566696b2d6e7572726f686d616e2f6d696e6966792f696e6465782f782d6d2d6c2e7068703f6272616e63683d6d61696e26636f6c6f723d253233346635643935266c6162656c3d782d6d2d6c2e706870266c6162656c436f6c6f723d253233316632333238267374796c653d666c61742d737175617265)

Motivation
----------

[](#motivation)

This project was started as a [gist](https://gist.github.com/taufik-nurrohman/d7b310dea3b33e4732c0/804ae266c30664e7dcdf1d7d544628f7790bdad8), which now has more stars than [the copy of it](https://github.com/mecha-cms/x.minify), that was actually made to abandon the gist. It was inspired by [a code snippet](https://ideone.com/Q5USEF), that will probably get lost in the future, so I decided to make [a copy of it](https://gist.github.com/taufik-nurrohman/db723da29e69065a1130).

I once got an e-mail from someone who wanted to use some parts of [my extension’s code](https://github.com/mecha-cms/x.minify), for him to use in a proprietary application, hoped not to be bound by [the GPL restrictions](https://mecha-cms.com/article/general-public-license). It was not possible legally at first, due to the nature that an extension will always be a part of its core application. And its core application, in this case, were using the GPL license from the start. And so, its extensions have to be licensed under the GPL license too.

I then decided to completely re-write this project under the MIT license because I no longer view this implementation as a “complex thing” that it takes a lot of effort to program it. I also want to make my implementation generally available to a wide range of people (including those who develop proprietary applications), so it will be easier for me to get financial support from them.

Usage
-----

[](#usage)

This converter can be installed using [Composer](https://packagist.org/packages/taufik-nurrohman/minify), but it doesn’t need any other dependencies and just uses Composer’s ability to automatically include files. Those of you who don’t use Composer should be able to include the `index.php` file directly into your application without any problems.

### Using Composer

[](#using-composer)

From the command line interface, navigate to your project folder then run this command:

```
composer require taufik-nurrohman/minify
```

Require the generated auto-loader file in your application:

```
