一個簡單的計(jì)數(shù)器
來源:程序員人生 發(fā)布時(shí)間:2013-11-05 10:28:38 閱讀次數(shù):2662次
-
-
-
- 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);
- # 返回計(jì)數(shù)值
- return ($count);
- }
- ?>
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈