I want to find a way to execute increment for every 5 mins, please help
example
for ($i=1;$i<=11;$i++) {
echo $i;
}
- after 5min
- after 5min
- after 5min
- after 5min
- after 5min ......
I want to find a way to execute increment for every 5 mins, please help
example
for ($i=1;$i<=11;$i++) {
echo $i;
}
sleep(300) will hold execution for 5 minutes.If you want to run a script every 5 minutes, you should use a cronjob. If you are using a control panel such as cPanel or DirectAdmin you can add the cronjob. If you have (only) SSH access to the machine then use the crontab -e command and add the following line:
*/5 * * * * /usr/bin/php /location/of/the/script.php
If you /usr/bin/phpis not your PHP path, then create a script and use <?php phpinfo(); to find out what the location actually is.
Use Cron Jobs or Sleep Function in php
if the cron jobs is disable on your server than use free online cron jobs service