Show results while script is still executing

前端 未结 4 749
遇见更好的自我
遇见更好的自我 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:35

    I had to put both ob-flush and flush as shown in this example:

    for($i=10; $i > 0; $i--)
    {
        echo "$i ...";
        flush();
        ob_flush();
        sleep(1);
    }
    

提交回复
热议问题