jadeg Posted April 21, 2014 Share Posted April 21, 2014 I have a PHP function and I want the function to be called every minute. I know how to do this in javascript, just don't know how to make it work in PHP. How do I go about that Link to comment https://forums.phpfreaks.com/topic/287921-calling-function/ Share on other sites More sharing options...
trq Posted April 21, 2014 Share Posted April 21, 2014 PHP doesn't execute inside an event loop like Javascript often does. You would need to use your operating systems task scheduler. On Linux, it is called cron. Link to comment https://forums.phpfreaks.com/topic/287921-calling-function/#findComment-1476893 Share on other sites More sharing options...
jadeg Posted April 22, 2014 Author Share Posted April 22, 2014 I have set up the cron job. To run on the website how do I go about that? Do I just run the script that has the cron job scheduled? Link to comment https://forums.phpfreaks.com/topic/287921-calling-function/#findComment-1476922 Share on other sites More sharing options...
trq Posted April 22, 2014 Share Posted April 22, 2014 Have cron execute the script that calls your function. Link to comment https://forums.phpfreaks.com/topic/287921-calling-function/#findComment-1476927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.