php vs htm,奇怪的差距 [英] php vs htm, weird gaps

查看:88
本文介绍了php vs htm,奇怪的差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正常的:


http://labvc.x10hosting.com/AT/site/home.htm


VS



奇数:


http://labvc.x10hosting.com/AT/site/home.php


当我看着代码并排,它几乎相同,唯一的事情,






编辑:
我检查并对代码进行了微小的更改,再次查看源代码。

两者都是完全相同的。






编辑:
在xml减速之前有一个像素宽的字符

解决方案

您的PHP输出有两个字节顺序标记在头部。



使用Firebug检查代码这是第一行

    

现在,所有这些有趣的字符只有UTF-8 BOM的ISO-8859-1解码( 0xEF 0xBB 0xBF )。



这些可能由您的IDE /编辑器添加到PHP文件本身的头部。检查您的偏好设置,并查看正在使用的编码。如果它是像UTF-8 + BOM,然后切换到只是UTF-8,这应该解决它。


the normal one:

http://labvc.x10hosting.com/AT/site/home.htm

VS

the odd one:

http://labvc.x10hosting.com/AT/site/home.php

when i look at the code side by side, its almost identical, the only thing that would make them give that weird gap should be the CSS but they're using the same sheet.

ideas?


EDIT: I checked and made minute changes to the code, look again at the source.
Both are EXACTLY the same. wtf is with this gap.


EDIT: there's a pixel wide character just before the xml deceleration, how do i stop it form occurring?

解决方案

Your PHP output has a double byte-order-mark at the head.

Inspecting your code with Firebug, I see this as the first line

<?xml version="1.0" encoding="UTF-8"?>

Now, all those funky characters there are just ISO-8859-1 decodings of the UTF-8 BOM (0xEF 0xBB 0xBF).

These are possibly added by your IDE/editor into the head of the PHP files themselves. Check your preferences and see what encoding is being used. If it's something like "UTF-8 + BOM" then switch it to just "UTF-8" and that should fix it.

这篇关于php vs htm,奇怪的差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆