views:

236

answers:

3

Are there any command line (not interactive, not web-based) tools that will reformat (pretty-print) PHP and Javascript code?

+2  A: 

Try this one for PHP: http://shadsplace.org/beautify-php/

Saggi Malachi
+3  A: 

For a PHP beautifier, you can also use this pear package PHP_Beautyfier, which can either be called from the command line or instantiated within your own PHP code. For the Javascript one instead, find an open discussion here

And
+1  A: 

I wrote an article explaining how to build a command-line JavaScript beautifier implemented in JavaScript. The best part - it takes under 5 minutes to do it, YMMV.

Cheers!
Shonzilla

Shonzilla