关于PHP的short_tag_open
比较老的 PHP 程序,常常使用简短风格,为了使这种代码可以被解释,必须开启 short_open_tag选项; 如果不改则会出现如下错误:
| Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/http/…/index.php on line 485 Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/http/…/index.php on line 485 Parse error: syntax error, unexpected T_STRING in /home/http/…/index.php on line 485 |
个人不喜欢把 short_open_tag 改成 On ,分析一下只要把代码中的 <? 改成 <?php , <?= 改成 <?php echo 。 一行Shell把它替换一下就OK:
LD on 10月 26th, 2008 | File Under PHP | 7 Comments -