1 <?php 2 $counts = ("hitcounter.txt"); 3 $hits = file($counts); 4 $hits[0] ++; 5 $fp = fopen($counts , "w"); 6 fputs($fp , "$hits[0]"); 7 fclose($fp); 8 echo "<h2>now,the hit count is:</h2>"."<h1>".$hits[0]."</h1>";?>
时间: 2024-10-09 15:38:16
1 <?php 2 $counts = ("hitcounter.txt"); 3 $hits = file($counts); 4 $hits[0] ++; 5 $fp = fopen($counts , "w"); 6 fputs($fp , "$hits[0]"); 7 fclose($fp); 8 echo "<h2>now,the hit count is:</h2>"."<h1>".$hits[0]."</h1>";?>