<?php
//统计网站pv数
if(is_file("pv.txt")){
//有
$count = file_get_contents("pv.txt");
$count += 1;
echo "当前页面的pv是:$count";
file_put_contents("pv.txt",$count);
}else{
//没有
file_put_contents("pv.txt","0");
echo "当前页面的pv是:0";
}
?>
<?php
//统计网站pv数
if(is_file("pv.txt")){
//有
$count = file_get_contents("pv.txt");
$count += 1;
echo "当前页面的pv是:$count";
file_put_contents("pv.txt",$count);
}else{
//没有
file_put_contents("pv.txt","0");
echo "当前页面的pv是:0";
}
?>