PHP Function to Minify HTML, CSS and JavaScript

1
2
<?php
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tested in the wild :)

3 Responses

I used this to minify html, it keeps leading spaces for text inside html tag, any reason for that?
@Buddhi Prabhath for example:

1
<a style="color: inherit;text-decoration: none;" href="http://www.streetdeal.sg/deal/86738/0/buffet/steamboat-buffet-at-vivo-city">
     Steamboat Buffet at Vivo City</a>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@Buddhi Prabhath Fixed already.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.