PHP Formatter

Indent PHP code and align braces in the PSR-12 style.

PHP Formatter

.php

Paste text or open a file to see the result.

What it does

Indents PHP and places braces and spaces the way the PSR-12 style guide sets out. It helps when you clean up old scripts or code pasted from forums before you work on it. You get the same PHP in a common, readable style.

About the .php format

.PHP file extension
File Type
PHP Source Code File
Developer
The PHP Group
Category
Web Files
MIME
application/x-httpd-php

PHP is a server-side scripting language which is used to generate dynamic web pages.

PHP Formatter questions

How do I use the PHP Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .php change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .php page lists programs and converters for it.