使用PHP在页面上直接输出中文的时候,有时候在浏览器上显示的是乱码的,我们可以通过header()方法,设置编码

header("Content-type: text/html; charset=utf-8");");