首页 > 开发 > PHP > 正文

两种设置php载入页面时编码的方法

2024-05-04 22:19:33
字体:
来源:转载
供稿:网友

php载入页面时设置页面编码的两种方法

1:输出meta标签:

1、在php mvc的控制器里面或php页面echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
2、在php页面或html页面<meta http-equiv="content-type" content="text/html; charset=utf-8">

2:使用header函数

在控制器或页面里面header("content-type:text/html; charset=utf-8");

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表