Show results while script is still executing

前端 未结 4 884
遇见更好的自我
遇见更好的自我 2020-11-28 06:16

Right now in order to see the results, I have to wait until the entire code is done executing. It hangs until it\'s complete and stays loading. Once it\'s finished it shows

4条回答
  •  醉酒成梦
    2020-11-28 06:52

    This one worked for me: (source)

    function output($str) {
        echo $str;
        ob_end_flush();
        ob_flush();
        flush();
        ob_start();
    }
    

提交回复
热议问题