2012-08-13 82 views
1

我在我的數據庫表中存儲程序,因爲它(我的意思是沒有規範的字符編碼等,只是複製和粘貼到數據庫)。像奇怪的數據庫輸出問題

#include <pthread.h> 
#include <errno.h> 
#include <vmcmt.h> 
... 

這裏是PHP

ob_start(); 
... 
fetching information from database and echoing  
$markup = ob_get_clean(); 

// Specify configuration 
$config = array(
    'indent' => true, 
    'output-xhtml' => true, 
    'wrap' => 200); 

// Tidy 
$tidy = new tidy; 
$tidy->parseString($markup, $config, 'utf8'); 
$tidy->cleanRepair(); 

// Output 
echo $markup; 

的問題是,我得到oupput從數據庫代碼一半丟失。我的意思是輸出必須是#include <pthread.h>只需#include

我所做

首先我想,也許它與整潔類相關:開啓調試,我看到它的確定與$markup。但是當我回應它時,得到了同樣的結果。試圖刪除所有輸出緩衝功能,整潔..並只是回聲內容。還是一樣的結果。我無法弄清楚,我錯過了什麼。

+0

什麼時候html丟失了?查看源代碼並檢查其中一個標籤是否沒有破壞它。即如果源實際上完成了輸出所在的位置。 – 2012-08-13 18:02:05

+0

@KasiaGogolek同時回顯最終輸出。 – heron 2012-08-13 18:04:23

+0

我收集到了,我的意思是輸出html源代碼的哪一點。 – 2012-08-14 08:03:26

回答

2

看看你的HTML頁面源代碼。假設<pthread.h>是一個html標記。你需要

// Output 
echo htmlentities($markup); 
+0

lol :)))現在我沒有頁面,但html混亂..只是標記。沒有視覺 – heron 2012-08-13 17:58:35

+0

http://screencast.com/t/ksyvxjKPz – heron 2012-08-13 17:59:22

+0

http://php.net/manual/en/function.nl2br.php – Tim 2012-08-13 17:59:31