I have a question.. Is there any way to run a php function once a day. For example. I have a function which find every Sunday of next year and apply some offers (such as discount to all products etc.) This function run every time that users refresh the page. I want to run this function once a day in order to check if that day is Sunday. If Sunday then it will execute, otherwise It will not execute. Any ideas?
Asked
Active
Viewed 2,396 times
3 Answers
0
If you're using LINUX
Use Cron Jobs
# run the script at 4:30am every day
30 4 * * * /usr/local/bin/php /home/me/myscript.php
If you're using WINDOWS
Use sheduled task
If you're using XAMP
C:\xampp\php\php.exe -f c:/xampp/htdocs/myscript.php

meda
- 45,103
- 14
- 92
- 122