我試圖使用PHP的一部分的HTML Tidy實現(http://www.php.net/manual/en/book.tidy.php)爲了重新格式化一大塊HTML。我遇到了一個問題,其中Tidy將輸出截斷到某個點(大約8K)。PHP HTML Tidy:緩衝區的大小限制
當我創建一個字符串,它是關於10K長&把它交給tidy_repair_string,像這樣:
$output = tidy_repair_string($output, array(
'indent' => true, // enforce indentation
'hide-comments' => true, // Remove the comments
'wrap' => 100, // Break each line after 100 chars
'output-html' => true, // Output as HTML
'char-encoding' => $encoding // The input/output encoding
), $encoding);
我之後8,070個字符的LOP斷一切。如果我用10個字符填充字符串的開頭,那麼最後只剩10個字符。
有沒有辦法改變tidy_repair_string的緩衝區大小,使它更大?
看着http://www.php.net/manual/en/tidy.getconfig.php似乎沒有配置選項,谷歌是非常無益的/我的谷歌福已經失敗了我,並沒有大量的文件圍繞此。任何幫助將不勝感激!
編輯:我使用XAMPP的可移植精簡版 - win32-1.8.1-VC9在Windows 7的問題仍然存在,甚至發生時,我改變php.ini文件使用memory_limit的= 900M
可能保存到文件並解析文件,而不是字符串? – StasGrin 2013-04-05 11:05:53