Home >php教程 >php手册 >php网页数字计数器代码

php网页数字计数器代码

WBOY
WBOYOriginal
2016-06-13 09:57:51898browse

php网页数字计数器代码 本款php计数器是一款用来统计网页的访问次数的简单的讲数器代码,利用txt文本文件与php fopen函数进行操作。

php教程网页数字计数器代码
本款php计数器是一款用来统计网页的访问次数的简单的讲数器代码,利用txt文本文件与php fopen函数进行操作。
*/
 

$log = 'log/count.txt';
 $count_img = 'img/counter';

 $fp = @fopen($log, "r+") or die($log.'数据文件不能打开!');
 $count = fgets($fp, 64);
 flock($fp, 2);
 $count = (int)$count + 1;
 rewind($fp);
 fputs($fp, $count);
 fclose($fp);
 if($conf_showcount == '1'){
  for ($i=0; $i    $num = substr($count, $i, 1);
   echo 'php网页数字计数器代码';
  }
 }

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn