php header gb2312

来源:互联网 发布:java 节假日api 编辑:程序博客网 时间:2024/06/14 21:55

php header gb2312

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