Jump to content

PHP Timer Script


newb

Recommended Posts


<?php

if (!file_exists('.cache')) {

     fwrite(fopen('.cache', 'w+'), time());

     $origin = file_get_contents('.cache');

}

else {

     $origin = file_get_contents('.cache');

}

$distance = time() - $origin;

if ($distance >= 172800) {

//SET VARIABLE OR DO WHATEVER BECAUSE IT HAS BEEN 48 HOURS

}

?>

 

Place that in a folder that has write permissions and then fire it by Cron or Scheduled Task. Depending on what your having it do (and how intense it is), I would fire the job once a minute.

Link to comment
https://forums.phpfreaks.com/topic/166014-php-timer-script/#findComment-875687
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.