您的位置:首页 > 编程语言 > PHP开发

TP5 提示Namespace declaration statement has to be the very first statement in the script

2017-07-13 17:14 525 查看


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型。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐