PHP Parse Error: syntax error, unexpected $end 解决方法

报这种错误:PHP Parse Error: syntax error, unexpected $end。有两种可能:

1:

//$str .= "?>/n";

这种情况?>被认为是php结束标记,造成语法错误,解决办法看你自己的代码

2:

使用了短标记<? php code ?>但是没有在php.ini中配置 short_open_tag = On

3:

curly bracket 花括号{}缺失或不匹配

4:

php中类定义是不能被分段的,函数中分段除外。原文是:

as in PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration.


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1