It was asked some time ago, but anyway, there is a good package, for many languages, here: https://sublime.wbond.net/packages/CodeFormatter

Answer from Surt on Stack Overflow
๐ŸŒ
Package Control
packagecontrol.io โ€บ packages โ€บ PhpBeautifier
PhpBeautifier - Packages - Package Control
This is a Sublime Text 2 plugin allowing you to format your PHP code. It uses php beautifier.
๐ŸŒ
Reddit
reddit.com โ€บ r/sublimetext โ€บ is there a currently working plugin for php code beautifying?
r/SublimeText on Reddit: Is there a currently working plugin for php code beautifying?
April 16, 2023 -

- CodeFormatter: (abandoned, throws errors)
- JSPrettier - doesn't support php
- Others I've tried just either don't work or can't find them in package control?

Do any of you have a php code beautifier plugin that works? Preferably an option to beautify on save. Thank you!

๐ŸŒ
GitHub
github.com โ€บ SublimeText โ€บ PhpBeautifier
GitHub - SublimeText/PhpBeautifier: Pear Php_beautifier plugin for Sublime Text 2
This is a Sublime Text 2 plugin allowing you to format your PHP code. It uses php beautifier.
Starred by 66 users
Forked by 17 users
Languages ย  Python
๐ŸŒ
Sublime Forum
forum.sublimetext.com โ€บ t โ€บ php-beautifier-plugin โ€บ 2958
Php_beautifier plugin - Plugin Announcements - Sublime Forum
October 26, 2011 - Hi, Just made a small plugin for sublime. It uses php_beautifier from pear channel http://pear.php.net/package/PHP_Beautifier/ You can grab it here https://github.com/SublimeText/PhpBeautifier or via package controle Regards
๐ŸŒ
GitHub
github.com โ€บ Ennosuke โ€บ PHP-Codebeautifier
GitHub - Ennosuke/PHP-Codebeautifier: This is a plugin for Sublime Text 3 that gives the option to run the phpcbf
This is a plugin for Sublime Text 3 that gives the option to run the phpcbf - Ennosuke/PHP-Codebeautifier
Starred by 13 users
Forked by 7 users
Languages ย  JavaScript 65.4% | Python 34.6%
๐ŸŒ
Package Control
packagecontrol.io โ€บ packages โ€บ PHP Codebeautifier
PHP Codebeautifier - Packages - Package Control
You need the PHP Codesniffer more precise the code beautifier from them. Clone this repo into your Packages folder of Sublime Text. If phpcbf is in your path you don't need to do much setup.
Find elsewhere
๐ŸŒ
Envato Forums
forums.envato.com โ€บ envato authors โ€บ theme authors
Anyone using Sublime Text 3? How do you autoformat/prettify PHP code with WordPress standards? - Envato Forums
September 27, 2014 - So I'm using Sublime Text 3 for last few months and I love it!! The only issue is that I can't find any nice autoformat plugin/package that works with PHP. I found it for HTML,CSS etc (HTML-CSS-JS Prettify) and it workโ€ฆ
๐ŸŒ
GitHub
github.com โ€บ driade โ€บ phpfmt8
GitHub - driade/phpfmt8: PHP formatter for Sublime Text 4, with PHP 8 support. Core for vscode/cursor/windsurf phpfmt plugin
PHPFmt is a PHP code formatter tailored for Sublime Text 4 with full support for PHP 8.x.
Starred by 75 users
Forked by 5 users
Languages ย  PHP 85.7% | Python 13.4%
๐ŸŒ
Sublime Forum
forum.sublimetext.com โ€บ t โ€บ req-code-formater-beautifier โ€บ 3729
Req.: Code Formater/beautifier - Plugin Development - Sublime Forum
January 9, 2012 - Code formating for: HTML CSS JS PHP โ€ฆ other langs. later ๐Ÿ˜‰ I think this future in Sublime Text 2 can bring alot of people because APP developers mostly use Microsoft Visual Strudio and other developers (web, scripting โ€ฆ) editors like this. I know code is indented when in new line but ...
๐ŸŒ
GitHub
github.com โ€บ stvenx โ€บ phpCb
GitHub - stvenx/phpCb: PHP code formatter for Sublime Text editor with PHP Code Beautifier
This is a Sublime Text 2 plugin allowing you to format your PHP code. It uses PHP Code Beautifier
Author ย  stvenx
๐ŸŒ
Sublime Forum
forum.sublimetext.com โ€บ t โ€บ code-beautify โ€บ 33359
Code Beautify - Technical Support - Sublime Forum
November 14, 2017 - I have mixed code of php, html, css and js. How can I make them beautiful in Sublime Text 3 ? Thanks
๐ŸŒ
GitHub
github.com โ€บ kbsali โ€บ Sublime-beautifier
GitHub - kbsali/Sublime-beautifier: PHP + Javascript (and more?) beautifier for Sublime Text 2
PHP + Javascript (and more?) beautifier for Sublime Text 2 - kbsali/Sublime-beautifier
Author ย  kbsali
๐ŸŒ
GitHub
github.com โ€บ akalongman โ€บ sublimetext-codeformatter
GitHub - akalongman/sublimetext-codeformatter: Code Formatter plugin for ST2/ST3
CodeFormatter is a Sublime Text 2/3 plugin that supports format (beautify) source code.
Starred by 772 users
Forked by 128 users
Languages ย  Python 90.8% | JavaScript 8.5%
๐ŸŒ
Package Control
packagecontrol.io โ€บ packages โ€บ phpfmt
phpfmt - Packages - Package Control
PHP formatter for Sublime Text 4, with PHP 8 support. Core for vscode/cursor/windsurf phpfmt plugin ... PHPFmt is a PHP code formatter tailored for Sublime Text 4 with full support for PHP 8.x.
๐ŸŒ
Sublime Forum
forum.sublimetext.com โ€บ t โ€บ neaten-up-my-php-auto-format โ€บ 26001
Neaten up my PHP - Auto Format - Technical Support - Sublime Forum
February 9, 2017 - Hey guys, I am new to Sublime text and so far I am loving it. I have set it up so that I can auto format css, html and js. But for love or money I cant figure out how to do it for PHP. I am using sublime text 3 on a mโ€ฆ
๐ŸŒ
Sublime Forum
forum.sublimetext.com โ€บ t โ€บ php-beautifier-error โ€บ 5223
PHP Beautifier error - General Discussion - Sublime Forum
April 2, 2012 - Hello, I found Sublime Package Control. Then installed PHP Beautifier. But the choice of Format: PHP error occurs in the console: Traceback (most recent call last): File ".\sublime_plugin.py", line 350, in run_ File ".\php_beautifier.py", line 14, in run File ".\subprocess.py", line 633, in ...
๐ŸŒ
GitHub
github.com โ€บ stvenx โ€บ SublimeText-PhpCb
GitHub - stvenx/SublimeText-PhpCb: PHP code formatter for Sublime Text editor with PHP Code Beautifier
This is a Sublime Text 2 plugin allowing you to format your PHP code. It uses PHP Code Beautifier
Author ย  stvenx