Actually question in the title. Task: Run the PHP script, but if all the conditions for its execution are not ready, then perform it again, after 10 seconds? Is there any kind of functionality in PHP?
Answer 1, Authority 100%
Here is an example, cycle limited three iterations ($ i & lt; 3
), which is performed with a delay of 10 seconds Sleep (10)
, if necessary, the number of iterations can be enlarged and / or add some condition instead of echo
& lt;? php
For ($ i = 0; $ i & lt; 3; $ i ++) {
$ Date = New DateTime ();
Echo "Iteration No. $ i, performed in." $ Date- & gt; Format ("H: M: S"). "& lt; br & gt;";
SLEEP (10);
}
Answer 2
For similar purposes, you can use CRON.