Home  >  Article  >  Backend Development  >  utf-8编码,有BOM头影响格局,去除还乱码

utf-8编码,有BOM头影响格局,去除还乱码

WBOY
WBOYOriginal
2016-06-13 12:36:25828browse

utf-8编码,有BOM头影响布局,去除还乱码!
rt,html/php/mysql统一用utf-8编码,如果php用有BOM的编码格式,就会影响页面布局,只要php中存在include就会在页面多显示一行空白;如果无BOM编码,直接所有中文都会乱码;如果无BOM编码,加上header(“Content-type: text/html; charset=utf-8″);还是会影响布局,看来这段代码就是加BOM头的功能。
我又不想在所有文件里都加上include字段,那样会代码冗余。
有没有什么好方法可以解决的?

编码 布局 乱码 utf-8 php
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn