PHPackages                             pfaciana/tiny-html-minifier - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pfaciana/tiny-html-minifier

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pfaciana/tiny-html-minifier
===========================

Minify HTML in PHP with just a single class

3.0.0(5y ago)1095.9k↓12.4%24MITPHP

Since Jul 27Pushed 5y agoCompare

[ Source](https://github.com/pfaciana/tiny-html-minifier)[ Packagist](https://packagist.org/packages/pfaciana/tiny-html-minifier)[ RSS](/packages/pfaciana-tiny-html-minifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (4)

Tiny Html Minifier
==================

[](#tiny-html-minifier)

[![Version 3.0.0](https://camo.githubusercontent.com/55f30def4a68344c0de905e67851fe21552f126e98f7c99bbe794e47be861c23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d332e302e302d626c75652e737667)](https://camo.githubusercontent.com/55f30def4a68344c0de905e67851fe21552f126e98f7c99bbe794e47be861c23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d332e302e302d626c75652e737667) [![MIT license](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667) [![Donate](https://camo.githubusercontent.com/2ee2c3802ed26d0340f0a534dbeb31e9fcbcbe2acf8333f8e45fdcc73ae83bf5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f676976652d646f6e6174696f6e2d79656c6c6f772e737667)](https://www.paypal.me/DevoneraAB)

[Changelog](changelog.md)

In short
--------

[](#in-short)

- A HTML minifier in PHP.
- It's really really fast.
- Only 1 file is required.
- Almost no regular expressions.
- Almost no options.

Details - What the minifier does
--------------------------------

[](#details---what-the-minifier-does)

- Remove HTML comments.
- Remove slash in self closing elements. ` />` becomes `>`.
- Remove ` type="text/css"` and `type="text/javascript"` in `style` and `script` tags.
- Minimize elements within ``. It will not keep any whitespace (except inside `script`).
- Minimize elements within `` but keep spaces between tags to preserve inline data (optional).
- Minimize inline SVG files (which are a bunch of XML tags).
- Minimize Custom Elements. They look like this: `My content`.
- Skip `code`, `pre`, `script` and `textarea` from being minified.

Install &amp; usage
-------------------

[](#install--usage)

**Composer**

```
composer require pfaciana/tiny-html-minifier
```

**PHP**

```
