php 包含文件之前的换行符

发布于 2024-11-09 15:32:44 字数 907 浏览 0 评论 0 原文

当包含 book.php 时,我得到一个看起来很奇怪的换行符:

echo'<div id="list-book">';
//here's where the linebreak appears
include('book.php');
echo'</div>';

在 FF firebug 中,换行符是可见的,当单击按退格键时,它会消失,并且在源代码中它根本不显示

(如果该信息有帮助)。我也尝试过这个,它也给出了一个奇怪的换行符,但看起来像 4 个选项卡(在 FF firebug 中):

<div id="list-book">
     //here's where the linebreak appears
    <?php include('book.php'); ?>
</div>

book.php 像这样开始:

<?php

//include
include($_SERVER['DOCUMENT_ROOT'] . '/config.php');

...

第一个输出是:

echo'<table id="table" class="list" cellspacing="0">'

奇怪(对我来说至少:))是当 book.php 通过 js ajax 加载更新时填充

换行符消失。

I get a strange looking linebreak when including book.php:

echo'<div id="list-book">';
//here's where the linebreak appears
include('book.php');
echo'</div>';

In FF firebug the linebreak is visible and when clicking pressing backspace it dissapears and in source code it does not show at all <div id="list-book"><table id="table-book" class="list" cellspacing="0"> (if that info helps). I also tried this which also gives a strange linebreak but that looks like 4 tabs (in FF firebug):

<div id="list-book">
     //here's where the linebreak appears
    <?php include('book.php'); ?>
</div>

book.php starts like this:

<?php

//include
include($_SERVER['DOCUMENT_ROOT'] . '/config.php');

...

and the first output is:

echo'<table id="table" class="list" cellspacing="0">'

Strange (to me at least :)) is that when the book.php gets updated via js ajax load that populate the <div id="list-book">the linebreak disappears.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慕烟庭风 2024-11-16 15:32:44

您始终可以调用/滥用“标头”函数来生成错误,告诉您输出首先从哪里开始。

You could always call/abuse the "header" function to generate an error telling you where output was first started.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文