PHP Flush that works… even in Nginx

前端 未结 8 951
既然无缘
既然无缘 2020-11-30 22:29

Is it possible to echo each time the loop is executed? For example:

foreach(range(1,9) as $n){
    echo $n.\"\\n\";
    sleep(1);
}

Instead

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 23:08

    I found that you can set:

    header("Content-Encoding:identity");
    

    in your php script to disable nginx gzipping without having to modify the nginx.conf

提交回复
热议问题