PHP automatically executes (pause) a page at a certain time. when sending an email, you cannot send all submitted emails at once, at first, I thought of the sleep () function in PHP.
PHP automatically executes (pause) a page at a certain time. when sending an email, you cannot send all submitted emails at once, at first, I thought of the sleep () function in PHP, but sleep didn't actually sleep. PHP used javascript-setInterval to execute a function cyclically at intervals. let's talk about the specific usage of setInterval:
SetInterval ("function", time); parameter 1. customize a function. parameter 2. interval
The following uses my project as an example: PHP uses javascript to execute an instance before a project cyclically at intervals:
XML/HTML code
-
- Function UpdateNew ()
- {
- UpdateMe ("54545.php ");
- }
- Script
- Updated on:
- OnClick = "var t = parseInt (jj. value); setInterval (UpdateNew (), t);"/>