I am looking for a program, free or cheap, that formats the PHP code nicely. Sometimes I do copy and paste and the formatting looks screwed up. I found online source formatting but I would like to have a standalone program or an extension in my Dreamweaver (Windows) as it would be nice if I could apply source code formatting for all my PHP pages along with HTML. Dreamweaver only formats XML-based source, it leaves PHP source code untouched.
Eclipse PDT should do the trick, if you're willing to switch to that.
In most good IDEs you can select all the code and then run what is usually the "indent" command which will automatically indent the code properly.
I sometimes use PHP_Beautifier
, which can be executed as a standalone tool from the commande-line, and does a really great job when you pass it the "right" options.
For every-day use/work/coding, Eclipse PDT, as an IDE, is a nice choice, too -- provided you have a powerful enough computer.
Eclipse PDT is really the best way to go if you have more than one file you plan on formatting. I use it regularly since it allows you to specify how to format your code by setting the syntax style in the options.
After all, your style may not be mine!