前言
Parse error: syntax error, unexpected end of file in。一开始出现这种错误,以为是编码的问题一直在转换编码,反复检查和数据库编码一样还是出现这种错误。终于在百度上get到了。
00x0错误原因
你应避免这样的写法, 这样写:
<?php if (condition): ?>
<div>你的html代码</div>
<?php else: ?>
<div>你的html代码</div>
<?php endif ?>
你也要避免以下写法:
{?>
<?php}
0x01解决
如果你使用了标签, 那在你的 php.ini 里的这一项, 把 off
改成 on
short_open_tag = Off