我想讓代碼顯示錯誤信息,同時刪除頁面內容php顯示錯誤信息和清理內容
EG。
<?
echo 'welcome';
if (login==0)
{
error("you can't access to this page");
}
content, content, content, content, content, content, content, content, content, content
ect.......
?>
輸出
you can't access to this page
的爲例刪除所有內容,但保留錯誤(「你不能訪問此頁」);
使用輸出緩衝:http://en.php.net/manual/en/ref。 outcontrol.php – kirilloid 2012-08-03 20:36:45