Rt
Reply to discussion (solution)
Set up scheduled tasks on the server
Use the Department of Crontab, the test
http://blog.csdn.net/fdipzone/article/details/7263361
How do I automatically execute PHP code when I arrive at 00:00 every day?
Using Scheduled Tasks
Scheduled Tasks ....
XX * * * */usr/bin/php-f/home/wwwroot/default/test/test.php
Make a bat file that uses the schtasks system command to execute the PHP file code you want to execute regularly, click the bat file to execute it, but you can also add tasks to your computer's system tasks.
You can refer to Ecshop's scheduled tasks
Window can then add tasks to the system task
Crontab can be used under Linux
Create a job, execute a stored procedure
Ignore_user_abort (); PHP scripts can continue to execute even if the client disconnects (such as turning off the browser).
Set_time_limit (0); Execution time is unlimited, php default execution time is 30 seconds, you can allow the program to execute indefinitely
$time _year=date (' Y ', Time ());
if ($time _year%4==0 && ($time _year%100!=0 | | $time _year%400==0))
{
$days = 366;
}
Else
{
$days = 365;
}
$interval = $days *24*60*60; Run once every other year
do{
Here you can enter the code you want to execute
Sleep ($interval);
}while (TRUE);
Crontab ... Why do you let PHP do this thankless?