Clear previously set headers php

前端 未结 4 911
忘掉有多难
忘掉有多难 2021-02-05 16:15

I would like to know if its possible to clear the current information stored in header_list()

if(headers_sent()){
    foreach(headers_list() as $header){
                


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 16:41

    Once header is sent we can not clear it. The best solution for it to turn on output_buffering in php.ini file.

    output_buffering = On
    

提交回复
热议问题