$script_url . '?t=' . time();
// set expires header
header('Expires: Thu, 1 Jan 1970 00:00:00 GMT');
// set cache-control header
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0',false);
// set pragma header
header('Pragma: no-cache');
$inputTime = strtotime('22.01.1970 00:02:55'); // green
$inputTime = strtotime('22.01.1970 00:03:15'); // yellow
$inputTime = strtotime('22.01.1970 00:03:30'); // red
$baseTime = strtotime('22.01.1970 00:00');
$cycleDuration = 180 + 20 + 120;
$x = ($inputTime - $baseTime) % $cycleDuration;
$color = null;
if ($x <= 180) {
$color = 'green';
} elseif ($x <= 200) {
$color = 'yellow';
} else {
$color = 'red';
}
var_dump($color);