Home > Backend Development > PHP Tutorial > 页面最顶部使用include后,会显示空白行,css也不正常,求解决办法

页面最顶部使用include后,会显示空白行,css也不正常,求解决办法

WBOY
Release: 2016-06-13 11:59:55
Original
1020 people have browsed it

页面最顶部使用include后,会显示空白行,css也不正常,求解决方法
页面是utf-8编码
编辑器:dreamweaver 页面属性已经勾选了 包括Unicode签名(BOM)(s)
这样页面顶部会显示一行空白,查看源代码什么都正常:

<?php include_once("inc.php");?><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head>
Copy after login


------解决方案--------------------
确定不是代码产生的对吧? 如果确定不是代码产生的话,换个编辑器用utf-8无bom头编码保存一下。
------解决方案--------------------
文件编码如果是utf-8,头部会占用3个字符,文件改成无bom看看。
------解决方案--------------------
“dreamweaver 页面属性已经勾选了 包括Unicode签名(BOM)(s)”

在DW中,按CTRL+J,编码,然后不要勾选此项,PHP本身是无法识别BOM头信息的,所以会出现COOKIE、SESSION、空白异常等状况

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template