一个简单的计数器
栏目:php教程时间:2013-11-05 10:28:38
-
-
-
- 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);
- }
- ?>
------分隔线----------------------------
------分隔线----------------------------