If you are on a linux server, you can create a cronjob, a scheduled task, execute a php script through the php executable. Creating a cron task is easy, run "crontab -e" through the shell, then add your command to the end of the file.
Example cron entries taken from http://mkaz.com/ref/unix_cron.html
#Run command at 7:00am each weekday [mon-fri] 00 07 * * 1-5 mail_pager.script 'Wake Up'
If you want to execute php script once a day ...
0 0 * * * /path/to/php.exe myscript.php
Remember that you are running the script through the CLI, so the $_GET / $_POST / $_SERVER super-globals will not exist (you can get around this with wget).
If you are in windows, you can use the Windows Task Scheduler to do the same.
source share