How to clear previously echoed items in PHP

前端 未结 5 1089
一生所求
一生所求 2020-12-02 14:21

In php, is there any way to clear/remove all previously echoed or printed items?

For example:



        
5条回答
  •  一向
    一向 (楼主)
    2020-12-02 14:50

    If a hacker let's say has access to your PHP file, he will also be able to remove the statement clearing the output buffer.

    If you are doing this because you are letting your users upload PHP scripts, let me tell you that this is an extremely bad idea.

    In both cases, doing what you are asking for adds 0 security.

提交回复
热议问题