<p>编码问题:如图</p> <p><a href="http://static.oschina.net/uploads/img/201302/27124723_2txj.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://static.oschina.net/uploads/img/201302/27124724_zr41.png" width="455" height="278" /></a></p> <p>我编辑的php文件是用utf-8,而浏览器默认用的gb2312。这里要注意,两个的编码对应起来才能正确显示。</p> <p>可以这样,在php文件加上如下html代码:</p> <p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p> <p>表明这个代码是用utf-8编写的,浏览器编码只要设置成“自动”就可以了。</p> <p>如果还不行,试验下在<?   ?>中加上:</p> <p>header("Content-Type: text/html;charset=gb2312");</p>
转载于:https://my.oschina.net/blazeq/blog/110607