What options are there for executing a PHP script at a certain time every day?

前端 未结 9 734
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 06:58

I have a PHP script that needs to be run at certain times every weekday. Is cron or Windows task scheduler the only way to do this?
Is there a way to set th

9条回答
  •  旧时难觅i
    2020-12-12 07:40

    Apart from cron or Scheduled Tasks, you can have your PHP script to always run it. The process should sleep (within a loop) until the time has reached. Then, the process could execute the remaining functions/methods. Or, you can set up another script (which will act as a daemon) to check for the time and execute the other script.

提交回复
热议问题