关于php和mysql以及html乱码的情况,无论何时记得一定用utf-8编码,这个是世界上所有的字符都可以兼容的。
在html中:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
在php中连接数据库的时候,链接了数据库之后:
在html中:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
在php中连接数据库的时候,链接了数据库之后:
设置编码:mysql_query("set names utf8");
还有就是文件编码格式最好保存为无BOM的utf-8格式