Joke Collection Website - Blessing messages - How does PHP send SMS regularly?
How does PHP send SMS regularly?
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
- Previous article:Greetings from patients
- Next article:1-9 How to express I miss you in code words?
- Related articles
- Can I get SMS notification before I change the 8 yuan package to the 4 yuan package?
- How to deal with landline harassing calls
- Beauty salons have the most annual celebration programs.
- Super QQ SMS reminder is a friend online reminder or a friend message reminder.
- How to airdrop an Apple phone to a stranger in the air?
- Will the piggy bank send a text message after 35 days?
- How to prevent being cheated during the Spring Festival?
- Parents' message to kindergarten girls
- Every time I go to Sinopec to refuel, I always recommend fuel treasure? Do you need this thing or not?
- What movies did Zhou Xun and Tony Leung Chiu Wai cooperate in?