新建 index.php 内容如下
<?
$count=0;
$counter_file="count.txt";
if(file_exists($counter_file))
{
$fp=fopen($counter_file,"r");
$count=0+fgets($fp,20);
fclose($fp);
}
$count++;
$fp=fopen($counter_file,"w");
fputs($fp,$count);
fclose($fp);
$fp = fopen ($counter_file, "r");
$array_count = 1;
while (!feof($fp))
{
$count= fgetc($fp);
$counter_array[$array_count] = $count;
$array_elements = count ($counter_array);
$array_count = $array_count + 1;
}
for($array_id=1;$array_id<$array_elements;++$array_id)
{
?>
<img src="images\<?=$counter_array[$array_id]?>.gif">
<?
}
?>
再建立 空的count.txt
再建立文件夹images 里面放入 0-9.GIF
就可以啦~