My friend gave me his PHP source code but the PHP files is messed up, how can I auto reformat it? I mean to convert to files which have standard newline, indent, etc...
How are you opening the file. You can use a program like phppad to open it and it should have the correct php format.
I am using Dreamweaver so it's the problem of code writing, not the editor. But I found some solutions, first I try PHP beautifier but it doesn't works quite well. Then I find UniversalIndent and It's OK. Thanks guy for answering