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

php网页数字计数器代码

WBOY
Release: 2016-06-13 09:57:51
Original
904 people have browsed it

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网页数字计数器代码';
  }
 }

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template