こんにちは私はこの基本的なランダム引用スクリプトを持っていますが、配列でページを出力したいと思います。つまり、「echo $ quote」の代わりに、「include('text.php、text2.php、text3」を使用してある種の配列を実行します。 php'); " 等
方法がよくわかりません。何か案は?
また、タイマーを目立つ選択機能にして、ランダムにプルするのではなく、循環するリストから選択するようにしたいと思います。
ありがとうございました :)
<?php
$cachefile = './current_t_id';
$time = $id = null;
$change_every = 3600;
include('text.php');
if(is_file($cachefile)) {
list($time, $id) = explode(' ', file_get_contents($cachefile));
}
if(!$time || time() - $time > $change_every) {
srand ((double) microtime() * 100000);
$id = rand(0,count($quotes)-1);
file_put_contents($cachefile, time().' '.$id); // update cache
}
echo ($quotes[$id]);
?>