一个简单的计数器
来源:程序员人生 发布时间:2013-11-05 10:28:38 阅读次数:2499次
-
-
-
- function get_hitcount($counter_file)
- {
-
-
-
-
- $count=0;
-
- if ( file_exists($counter_file) )
- {
- $fp=fopen($counter_file,"r");
-
- $count=intval( fgets($fp,20));
-
- fclose($fp);
-
- }
-
- $count ;
-
- $fp=fopen($counter_file,"w");
- fputs($fp,$count);
- fclose($fp);
- # 返回计数值
- return ($count);
- }
- ?>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠