我想让代码显示错误信息,同时删除页面内容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