当前位置: 首页 > 图文教程 > 网络编程 > PHP > php格式化工具Beautify PHP小小BUG

PHP
php生成文件
MySQL中create table语句的基本语法是
NOT NULL 和NULL
最令PHP初学者们头痛的十四个问题
关于mysql 字段的那个点为是定界符
mysql_fetch_assoc和mysql_fetch_row的功能加起来就是mysql_fetch_array
MySQL相关说明
PHP 的 __FILE__ 常量
php防注
在数据量大(超过10万)的情况下
解决中英文字符串长度问题函数
一个更简单的无限级分类菜单代码
mysql 的 like 问题,超强毕杀记!!!
php批量删除数据
解决phpmyadmin中文乱码问题。。。
php中的时间显示
php中的登陆login
php中截取字符串支持utf-8
php5.2.0内存管理改进
php中通过smtp发邮件的类,测试通过

php格式化工具Beautify PHP小小BUG


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 168 ::
收藏到网摘: n/a

Beautify PHP is written entirely in PHP. The program was tested with Linux and Windows, PHP 4.1.0 and PHP 4.3.1, but it should work on most systems running PHP.

Beautify PHP,很好用的php格式化工具
http://www.bierkandt.org/beautify/
http://pear.php.net/package/PHP_Beautifier/download
最近组内来新人,他们代码不太规范的时候看得实在不舒服
这个工具实在很好用,再乱的代码瞬间就格式化好了
丢到linux下还可以快速批量处理@.@
好了,以下是本帖主题:
Beautify PHP格式化符号时,遗漏了^=和&=判断,
在beautify_php.class.inc第426行,增加这两个符号
// add space before chars = < >
if ($i > 0 AND !$this->_comment) {
if (($a[$i] == "=" OR $a[$i] == "<" OR $a[$i] == ">" OR $a[$i] == "*")
AND preg_match("/([ |!|=|.|<|>|-|+|*|/|^|&]+)/", $a[$i-1]) == 0) {
$this->_outstr = rtrim($this->_outstr)." ";
}
}