PHP代码格式化器/美化器和PHP美化一般 [英] Php code formatter / beautifier and php beautification in general

查看:73
本文介绍了PHP代码格式化器/美化器和PHP美化一般的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道用于很好地格式化凌乱的php代码的任何好的工具吗?最好是Aptana/Eclipse的脚本,但是独立工具也可以.

Do you know any good tools for nicely formatting messy php code? Preferably a script for Aptana/Eclipse, but a standalone tool will do too.

推荐答案

PHP代码美化器是一个有用的免费工具,尽管它们的下载页面确实需要创建一个帐户.

PHP Code Beautifier is a useful free tool that should do what you're after, although their download page does require an account to be created.

该工具已被分为3个版本:

The tool has been declined into 3 versions:

  • 一个GUI版本,可以直观地处理文件.
  • 允许与其他工具(CVS,SubVersion,IDE ...)批处理或集成的命令行版本.
  • 作为PHPEdit的集成工具.
  • A GUI version which allow to process file visually.
  • A command line version which allow to be batched or integrated with other tools (CVS, SubVersion, IDE ...).
  • As an integrated tool of PHPEdit.

基本上,它将变为:

if($code == BAD){$action = REWRITE;}else{$action = KEEP;}
for($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10;}}}

进入

if ($code == BAD) {
    $action = REWRITE;
} else {
    $action = KEEP;
}
for($i = 0; $i < 10;$i++) {
    while ($j > 0) {
        $j++;
        doCall($i + $j);
        if ($k) {
            $k /= 10;
        }
    }
}

这篇关于PHP代码格式化器/美化器和PHP美化一般的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆