utf-8 bom头问题 thinkphp 报错 Namespace declaration statement has to be the very first statement in the script
<?php
namespace app\admin\controller;//命令空间
use think\controller;
class Entry extends Controller
{//首页
public function index()
{
echo 'Hello,ThinkPHP!';
}
}
在访问上面的代码页面里,出现了
Namespace declaration statement has to be the very first statement in the script
这样的错误,我搜索了网上,很幸运的到了答案,原来是在保存文件的过程格式应该选择utf-8无BOM型。