php如何设置页面编码

来自:互联网
时间:2020-09-29
阅读:

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");
返回顶部
顶部