PHP+TXT简单计数器

55gY 944 0

[successbox title="PHP+TXT简单计数器"]

<?php
$filepath="txt.txt";
$file = fopen($filepath,"r");
$idsum=fgets($file);
fclose($file);
$file2 = fopen($filepath,"w");
$idsum1=(integer)$idsum+1;
echo "您是第";
echo $idsum1;
echo "位访客";
fwrite($file2,$idsum1);
fclose($file2);
?>

[/successbox]

发表评论 取消回复
表情 图片 链接 代码

分享