這裏需要一些PHP幫助,包含的內容顯示爲'1',這意味着它的真實性,但需要它的內容出現,而我不確定它爲什麼不是。這裏是一個功能的簡化版本:在ob_start()中使用include()
public function content {
$website->content = 'Some content here. ';
ob_start();
include('myfile.php');
$file_content = ob_end_clean();
$website->content .= $file_content;
$website->content .= ' Some more content here.';
echo $website->content;
}
此輸出:
Some content here 1 Some more content here
當我需要它輸出:
Some content here 'Included file content here' Some more content here
任何想法就是我如何解決這個問題?
謝謝你,那有效。 – 2011-12-14 19:48:19