There are loads of online beautifiers for HTML and Javascript (or only PHP), but when you mix PHP into that, the result is a beautified HTML/JS and non-beautified PHP.

Are there any free online beautifiers that work with PHP as well as HTML and/or Javascript?

  • A year gone. Still insist on "free"? – Ira Baxter Apr 17 '16 at 3:59
  • @IraBaxter personally, I don't really need it anymore, but if you have a paid solution, you're welcome to post it and I'll +1 it -- it would definitely be useful to someone out there! :) – ᔕᖺᘎᕊ Apr 17 '16 at 9:19

Semantic Designs' (my company) offers a PHP Formatter and also a JavaScript formatter.

The PHP formatter formats PHP code nicely. It formats any HTML found between PHP fragments reasonably considering that that the HTML is broken into arbitrary fragments by the intervening PHP elements. It does not touch code inside <script> tags.

The JavaScript formatter will format JavaScript, including that inside <script> tags embedded in HTML text.

The pair of these do what OP is looking for.

They are not online, and they are not free. OP requested "online" and "free", but got no responses in over a year.

  • Thanks! +1, hope it helps someone! :D – ᔕᖺᘎᕊ Apr 17 '16 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.