PHP auto-formatter?



  • Ok, I'm not going to ask for a PHP IDE because I'm already 99% sure none I'd be happy with exist.

    But! I do need something to "pretty print" a PHP script, which has unaligned tabs and various other formatting problems that are making it really hard to read and digest. Any tips?

    Edit: Er, I found an online one: http://beta.phpformatter.com/ so. Yeah.



  • You might still give PhpStorm a 1% shot. It's quite nifty.



  •  Doesn't pastebin autoformat stuff?



  • @rootkit said:

    You might still give PhpStorm a 1% shot. It's quite nifty.

    I use its sister product WebStorm for all my Javascript and HTML needs and I'm very happy with it. Based on that alone, I would trust PhpStorm.

    Edit: WebStorm integrates with Git so surely Blakey won't be able to resist to try it out ;p



  • @bjolling said:

    @rootkit said:

    You might still give PhpStorm a 1% shot. It's quite nifty.
    I use its sister product WebStorm for all my Javascript and HTML needs and I'm very happy with it. Based on that alone, I would trust PhpStorm.

    Edit: WebStorm integrates with Git so surely Blakey won't be able to resist to try it out ;p


    PhpStorm does HTML, Javascript and CSS as well. And SQL. Plus a few more. Even inside PHP code (either through auto-detection or assisted; you can help the parser by using e.g. HTML / JS / CSS / SQL as heredoc or nowdoc variable delimiters).



  • Just in case you're still looking after half a year, I find this pretty nifty. It's great for those sites that minify their only copy of the JavaScript and then you have to debug it. Much easier to read with proper whitespace.



  • @Ben L. said:

    Just in case you're still looking after half a year, I find this pretty nifty. It's great for those sites that minify their only copy of the JavaScript and then you have to debug it. Much easier to read with proper whitespace.

    Did that site lose the ability to pretty print PHP since you posted the link? Or did you just not read the OP?



  •  You've already found something, but sublime text has a reindent function.


Log in to reply