Processing large amounts of data in PHP without a browser timeout

前端 未结 4 806
谎友^
谎友^ 2020-12-23 15:12

I have array of mobile numbers, around 50,000. I\'m trying to process and send bulk SMS to these numbers using third-party API, but the browser will freeze for some minutes

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 15:51

    Cronjob would be your best bet, I don't see why it would take any longer than doing it in the browser if your only problem at the moment is the browser timing out.

    If you insist on doing it via the browser then the other solution would be doing it in batches of say 1000 and redirecting to the same script but with some reference to where it got up to last time in a $_GET variable.

提交回复
热议问题