總裁
|
1#
大 中
小 發表於 2007-11-28 09:03 顯示全部帖子
10行以內--PHP文字計數器
超簡潔的文字計數器...只有9行...只需要兩個檔...counter.php & counter.txt
內容如下:引用:<?
$counter = "counter.txt";
$fd = fopen($counter, "r");
$num = fread($fd, filesize( $counter ));
fclose($fd);
$fd = fopen($counter, "w");
$users = $num + 1;
echo "$users";
fwrite($fd, $users);
fclose($fd);
?>
|