簡體   English   中英

php 包含文件之前的換行符

[英]linebreak before php included file

包含 book.php 時,我得到一個奇怪的換行符:

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

在 FF firebug 中,換行符是可見的,當單擊按退格鍵時它會消失,並且在源代碼中它根本不顯示<div id="list-book"><table id="table-book" class="list" cellspacing="0"> (如果該信息有幫助)。 我也試過這個,它也給出了一個奇怪的換行符,但看起來像 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');

...

第一個 output 是:

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

奇怪(至少對我來說:))當 book.php 通過填充<div id="list-book">的 js ajax 加載更新時,換行符消失了。

您總是可以調用/濫用“標題” function 來生成一個錯誤,告訴您 output 的首次啟動位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM