php如何设置页面编码

php设置页面编码的方法:

1、在php mvc的控制器里面或php页面输出meta标签

echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';

在php页面或html页面

<meta http-equiv="content-type" content="text/html; charset=utf-8">

2、使用header函数

在控制器或页面里面加入语句:

header("content-type:text/html; charset=utf-8");
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容