前一段时间写PHP,经常在解析文件之前就要对数据进行处理判断,并以header()的方式进行页面跳转.然而后来将文件放到 linux 服务器时常碰到header()解析出错的情况,而在 windows 开发环境中本地调试无任何问题.后来发现是文件编码格式的原因,转换成以UTF-8无BOM编码格式的文件就不会报错了. 附上BOM的解释:https://en.wikipedia.org/wiki/Byte_order_mark 以及知乎上的讨论:「带 BOM 的 UTF-8」和「无 BOM 的 UT
一.变量输出的几个方法 <?php namespace app\index\controller; use http\Params; use think\Config; use think\Controller; use think\Request; use think\View; import('filter', APP_PATH . 'common', ".php"); class Index extends Controller { /** * @param Request
In order to omit the byte order mark (BOM), your stream must use a custom instance of UTF8Encoding instead of the default System.Text.Encoding.UTF8: 1.Call the UTF8Encoding constructor with False for the encoderShouldEmitUTF8Identifier parameter. 2.P