Home >Backend Development >PHP Tutorial > 帮忙瞧个源码

帮忙瞧个源码

WBOY
WBOYOriginal
2016-06-13 12:44:18845browse

帮忙看个源码

<html><br />
<head><br />
<br />
</head><body><br />
<?php<br />
<br />
<br />
$filename = 'english.dat'; //数据文件名<br />
$refresh = 1; //更新周期(以秒为单位,可根据需要自行调整)<br />
$data = file($filename); //将数据文件装入一个数组<br />
$num_lines = count($data); //数据文件行数,也就是记录条数 <br />
mt_srand(floor(time() / $refresh));<br />
$id = mt_rand(0, $num_lines - 1); //随机选择一条记录号<br />
$content = chop($data[$id]); //根据记录号选择相应的数据,并截去最后的换行符<br />
echo $content; //用javascript形式输出数据<br />
<br />
<br />
?><br />
<br />
</body><br />
</html>

这个是我从网上找到定时更新页面的源码,我想问下这个实现定时功能就是没有注释那段是什么意思,我不是很理解。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn