PHP計(jì)數(shù)器
來源:程序員人生 發(fā)布時(shí)間:2013-11-06 12:11:07 閱讀次數(shù):3379次
- <?php
- $counterFile = "balong.txt";
-
- function displayCounter($counterFile) {
- $fp = fopen($counterFile,"rw");
- $num = fgets($fp,5);
- $num += 1;
- print "您是第 "."$num"." 個(gè)看巴瀧計(jì)數(shù)器的家伙";
- exec( "rm -rf $counterFile");
- exec( "echo $num > $counterFile");
- }
-
- if (!file_exists($counterFile)) {
- exec( "echo 0 > $counterFile");
- }
-
- displayCounter($counterFile);
- ?>
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)