php header utf8
header函数前不能向页面输出任何内容,也就是不能使用echo、print、print_r等函数输出内容
header("Content-type: text/html; charset=utf-8");上面的这句等同于HTML中的<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
完整用法
<?php
header("Content-type: text/html; charset=utf-8");
?>