В данном случае слова с периодом в 3 секунды
<?
$period = 3;
if (file_exists("last_time")) {
$last_time = @file_get_contents("last_time");
$current_time = time();
} else {
$current_time = time();
$last_time = $current_time-$period;
}
$steps = floor(($current_time - $last_time) / $period);
if ($steps > 0) {
$words_list = array("слово 1", "слово 2", "слово 3", "слово 4", "слово 5", "слово 6", "слово 7", "слово 8");
$words_add = array();
for ($i = 0; $i < $steps; $i++) {
$words_add[] = $words_list[rand(0, count($words_list)-1)];
}
$f = fopen("words", "a+");
fwrite($f, implode("<br>", $words_add) . "<br>");
fclose($f);
file_put_contents("last_time", $current_time);
}
echo @file_get_contents("words");
?>
<script>
setTimeout(function () {document.location.reload(); }, 3000);
</script>