【发布时间】:2010-11-06 16:15:36
【问题描述】:
在 php 中,有什么方法可以清除/删除所有以前回显或打印的项目?
例如:
<?php
echo 'a';
print 'b';
// some statement that removes all printed/echoed items
echo 'c';
// the final output should be equal to 'c', not 'abc'
?>
我的脚本使用包含函数。包含的文件不应该回显任何内容。以防万一有人(例如黑客)尝试,我需要一种删除方法。
【问题讨论】:
-
如果您将其作为“安全措施”,您可能做错了。你应该考虑用不同的方法来解决这个问题。也许创建另一个问题来说明您的问题是什么?
-
我使用的是oci_execute,如果查询失败,会回显warning信息。但是我正在单独处理错误并且不想要 oracle 消息。所以这个问题也适用于这种情况
标签: php output echo output-buffering