Joke Collection Website - Blessing messages - How does PHP send SMS regularly?

How does PHP send SMS regularly?

1, set the server first;

2. Set the execution time to unlimited;

3. Set the interval of sending short messages to 5 minutes;

4. Open the file storing the short message, execute the short message operation, and close the file;

5. Cycle the above process;

6. The specific setting code is as follows:

ignore _ user _ abort(); ? //Even if the client disconnects (such as closing the browser), the PHP script can continue to execute.

set _ time _ limit(0); ? //? The execution time is unlimited, and the default execution time of php is 30 seconds. Can a program be executed indefinitely through set_time_limit(0)?

$ interval = 60 * 5; ? //? Run every five minutes?

Do {?

$fp? =? fopen('test.txt ',' a '); ?

fwrite($fp,' test '); ?

fclose($ FP); ?

Sleep ($ interval); ? //? Wait five minutes?

}while (true); ?

& gt