Home
PHP Code Beautifier
This tool is designed to beautify PHP code, applying most of the PEAR standard requirements to it. It can even process really scrambled scripts, e.g. all code in one line, and thus may help you to get scripts into a more readable form.
What this tool does:
General:
- Sets missing line breaks without removing any additional line breaks that you may use to group related things.
- Corrects wrong indentation according to the level of nested braces.
Pear standard requirements:
- Tries to set missing curly braces around single conditional statements. This may not work in all situations.
- Indents with four spaces.
- Uses "one true brace" style in function definitions.
- Sets one space between control keyword and condition.
- Removes space between function calls, parenthesis and beginning of argument list.
What it doesn't:
General:
- It does not sanity-check or correct your code. This is no debugging tool, it only arranges things properly.
- It does not support the "if: ... endif;" syntax for control structures when indenting.
- This tool is dedicated to beautify php code. In case you use php embedded into html, best thing would be to submit only the php parts.
Pear standard requirements:
- It does not add spaces on either side of the assignment operator (but I might add this on request).
- It currently does not convert different php tags into the recommended form.
- It does not do anything about naming conventions or commenting style or the way you include other scripts, this is entirely up to you.
What can happen in the worst case?
Worst thing that may happen is that the output on the following page is not what you expected. In this case, you don't need to do anything at all. Otherwise, if you like what you see, you can simply copy the output from the browser view and paste it into in your scripts.
OR:
Please direct suggestions, bug reports, or any other feedback referring to the original script to http://www.tote-taste.de/X-Project