在 apache 的配置文件 httpd.conf 最末行添加 AddDefaultCharset UTF-8


插入数据库时中文乱码,则使用 mysql_query("set names 'utf8'");