How To Use setInterval in PHP?

后端 未结 8 1947
刺人心
刺人心 2020-12-08 16:11

I want to ask that how can i use php function again and again after some time automatically just like setInterval in Javascript. We set the time and it is on its job until t

8条回答
  •  孤街浪徒
    2020-12-08 16:56

    It isn't clear what you want to achieve exactly.

    Are you aware that PHP only delivers content on request?

    If you want the server to update something once in a while (a file for example), use a cronjob (on *nix).

    If you want your WEBPAGE to re-query something, do it in javascript and call a PHP script that delivers fresh content.

提交回复
热议问题