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

来源:互联网 发布:java语言和c语言 编辑:程序博客网 时间:2024/06/07 01:40

utf-8 bom头问题 thinkphp 报错 Namespace declaration statement has to be the very first statement in the script


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





阅读全文
0 0
原创粉丝点击