How can I rotate a PHP included file on an hourly rotation schedule?
I have a index.php and four files with some content. I want, for every six hours, a different content-file will be included.
For example, in the first time period:
<?php include 1.php ?>
Some hours later:
<?php include 2.php ?>
Again, some hours later:
<?php include 3.php ?>
I already tried Googling and made something like this:
<?php
// starting date for rotation
$startDate = '2013-09-10';
// array of filenames
$files = array('1.php','2.php','3.php','4.php');
$stamp = strtotime($startDate);
$days = (time() - $stamp) / (0*0*6);
$filesName = $files[$days % count($files)]
?>
<?php include $filesName; ?>
However, this does not work.
How can I fix this?