Code: Select all
ignore_user_abort(true);
set_time_limit(0);
while(true)
{
//actions here
sleep(100); // or how many ever seconds you want the script to be halted for
}A cron job is a task that the server does automatically (without anyone visiting a page). A lot of control panels offer an interface to cron, making it easy to set up a cron.
Yours might look like this
Code: Select all
/usr/bin/php /home/myaccount/public_html/my_script.phpYou can set your cronjobs to run every second, every minute, hour, day, etc etc etc... any time you want.