Is there a way to make PHP progressively output as the script executes?

前端 未结 4 1745
孤城傲影
孤城傲影 2020-12-18 07:16

So I\'m writing a disposable script for my own personal single use and I want to be able see how the process is going. Basically I\'m processing a couple of thousand media r

4条回答
  •  情话喂你
    2020-12-18 07:42

    Here's a PHP package which wraps it up :

    https://packagist.org/packages/coderofsalvation/browser-stream

       BrowserStream::enable();
        BrowserStream::put("loading");
    
        for( $i = 0; $i < 10; $i++ ){
            BrowserStream::put(".");
            sleep(1);
        }
    

提交回复
热议问题