Echo messages while php script still executes

前端 未结 9 1050
轻奢々
轻奢々 2021-02-08 13:05

I have a php script that uses cURL and takes about 10-15 minutes to execute. What it does, it parses about 1000 pages looking for specific matches and throughout the script I ha

9条回答
  •  滥情空心
    2021-02-08 13:26

    You could use both flush and ob_flush, reminding to set the content type header:

    ';
        flush();
        ob_flush();
        sleep(1);
    }
    

    Source: dermeister note in php.net ob_flush page.

    Tested on Firefox 42.0 and Chrome 46.0

提交回复
热议问题