Echo messages while php script still executes

前端 未结 9 1055
轻奢々
轻奢々 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 create a staging table.

    The PHP script could, instead of echo'ing the message, store them into a database table (possibly memory table for performance).

    You could then periodically poll a seperate PHP script using ajax, which would query the table, and return any new messages to the client.

提交回复
热议问题